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
I'd like to get the actual values for the ComplexMethod, LongMethod and ComplexCondition rules in the message from Detekt.
Current Behavior
At this moment, Detekt returns messages without actual values for metrics.
For the rule ComplexMethod it returns a message without a value: The function main appears to be too complex.
For the rule LongMethod it returns only the threshold (but not the actual value): The function main is too long. The maximum length is 60.
For the rule ComplexCondition, it returns neither actual nor threshold values: 'This condition is too complex.'
At the same time, standard linters for other languages often returns these value.
For example, checkstyle does it for all the metrics:
Cyclomatic Complexity is 15 (max allowed is 14).
NCSS for this method is 120 (max allowed is 100).
Boolean expression complexity is 6 (max allowed is 4).
Context
We build an education platform and analyze learner's solutions for our code challenges. We parse all the output from linters and take all the values to produce some general feedback for their code. In addition, learners can use the values to simplify their code. If the actual value is displayed it's easy to see how much more a learner needs to simplify the functions. This is especially helpful for beginners in Kotlin.
The text was updated successfully, but these errors were encountered:
swsms
changed the title
Return the value for the ComplexMethod rule
Return the actual values for complexity rules
Mar 30, 2020
Good idea! Please go ahead.
May I ask you @swsms to submit a PR with your suggestions, so that we can review and merge it later?
It better highlights the changes, when one sees the actual code.
The following lines need to be adapted (including tests):
Expected Behavior
I'd like to get the actual values for the
ComplexMethod
,LongMethod
andComplexCondition
rules in the message from Detekt.Current Behavior
At this moment, Detekt returns messages without actual values for metrics.
For the rule
ComplexMethod
it returns a message without a value:The function main appears to be too complex.
For the rule
LongMethod
it returns only the threshold (but not the actual value):The function main is too long. The maximum length is 60.
For the rule
ComplexCondition
, it returns neither actual nor threshold values:'This condition is too complex.'
At the same time, standard linters for other languages often returns these value.
For example,
checkstyle
does it for all the metrics:Context
We build an education platform and analyze learner's solutions for our code challenges. We parse all the output from linters and take all the values to produce some general feedback for their code. In addition, learners can use the values to simplify their code. If the actual value is displayed it's easy to see how much more a learner needs to simplify the functions. This is especially helpful for beginners in Kotlin.
The text was updated successfully, but these errors were encountered: