Ncss Type Count violation

Rudy picture Rudy · Nov 15, 2011 · Viewed 42.8k times · Source

I'm not really clear with this violation raised by PMD. Basically I have 2 questions:

  1. What should I do to get rid of this violation?

  2. What does the following statement mean?

The type has an NCSS line count of 944 Parameters
minimum: The type NCSS count reporting threshold: Default is 1500.

Answer

Mike picture Mike · Nov 15, 2011

PMD Code size rules.

NCSS stands for Non-Commented Source Code lines. Methods and/or classes that have high NCSS counts are (at a very high level) too long, and can probably be split up. High numbers of NCSS are bad.

Additionally, it sounds like you might be using Sonar version 2.10 or prior, as Sonar Bug 2676 was fixed in 2.11.