You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Java] NARGS and cognitive metrics appear incorrect for simple methods #1250
With rust-code-analysis-cli 0.0.25, the Java NARGS and cognitive metrics appear incorrect for a minimal class with a one-parameter method and one if statement.
rust-code-analysis-cli -p MetricsFixture.java --metrics --output-format json --output out
Expected
Based on the documented metric meanings, method one has one argument and cognitive complexity 1; method two has zero arguments and cognitive complexity 0.
Observed
In the function-space metrics, one reports NARGS functions_min/functions_max as 3 and cognitive min/max as 0. two reports NARGS functions_min/functions_max as 2 and cognitive min/max as 0.
This makes the Java NARGS and cognitive values unsuitable for simple per-function measurements. Please clarify whether these JSON fields have different semantics or whether the Java grammar/metric implementation needs correction.
Activity