cogito, cognitive complexity for D

Eugen Wissner belka at caraus.de
Fri May 27 11:51:33 UTC 2022


On Tue, May 24, 2022 at 11:25:38PM +0200, Christian Köstlin via Digitalmars-d-announce wrote:
> and I am wondering what real world "numbers" are. Is e.g. 20 a "good" or
> "bad" number?

Module thresholds aren't useful for everyone, D modules can be pretty
large.

I see different values used for aggregate and method thresholds.

- PHP's simplify (set of tools) suggests 8 and 50
  (https://github.com/symplify/phpstan-rules/blob/de025c98988a85d0345b376408630e84b585cd20/packages/cognitive-complexity/config/cognitive-complexity-rules.neon)
- If I remeber correctly, Sonar Qube itself uses only the method
  cognitive complexity and the maximum is 15.
- “Genese Cpx” has only method complexity but has a warning and error
  thresholds of 5 and 10, respectivly
  (https://www.npmjs.com/package/@genese/complexity).

> Another question that comes to mind is, if the dmd frontend could be made
> available as a dub package, which would simplify the build process?

I'll try to build with dub's package. I've only seen a fork of the dmd
frontend as dub package, but should have missed the dmd package itself.


More information about the Digitalmars-d-announce mailing list