Conversation
|
I think we would rather solve that with a |
|
Previously, the check ignored Constraint::new in method references when calculating class fan-out complexity. This was a false negative. Now fixed, the check correctly counts Constraint::new as a dependency, which is why complexity is increased to 21. |
|
Just for the record I started a proposal in the past to increase the value to 25, thinking that it was default value in checkstyle, see: https://forum.xwiki.org/t/classfanoutcomplexity-metric/9311. We didn't continue the discussion because I was wrong and so we kept the default, and then we added several new exclusions to the count (e.g. https://forum.xwiki.org/t/excludes-initializable-disposable-and-initializationexception-for-classfanoutcomplexity/15479). Now personally I still have the feeling 20 is often a bit low so we could also restart that discussion. But we need a proposal before performing this kind of change. |
Yes, this PR is definitely not the right way to deal with this situation. We are not going to change the general rule for this specific case. We could change the general rules for other reason (as mentioned by @surli) but in any case I really doubt the result of the discussion would be |
|
@tmortagne , do you prefer suppression by annotation ? We can change PR to suppress all violations due to this defect fix, to let your team to decided later on better approach. |
It seems to me this is what would make the most sense on your side. You are not going to wait for us to endlessly debate on which number we want in the rule :) |
|
@Anmol202005, please change PR to use suppressions. |
|
PR with suppressions raised : xwiki/xwiki-platform#3916 |
Updated Checkstyle Configuration: ClassFanOutComplexity max value
Summary
This PR updates the checkstyle configuration to increase the
ClassFanOutComplexitymax property from 20 to 21.Motivation
A recent build failure was detected in xwiki-platform-livedata-livetable where
LiveTableLiveDataConfigurationResolver.javahas a ClassFanOutComplexity of 21, exceeding the current max allowed value of 20.Details
Implementation Notes
This PR should be merged after we release the new Checkstyle version and xwiki upgrades to it. Without this change, existing code that was previously compliant may fail validation checks.
Testing Done
Verified that the updated configuration resolves the build error while maintaining code quality standards.