Skip to content

cache TooManyLinesOfCodeInFunctionCheck.getNumberOfLine #1503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2018

Conversation

ivangalkin
Copy link
Contributor

@ivangalkin ivangalkin commented Jun 21, 2018

this function is called 3 times for each function declaration

  • TooManyLinesOfCodeInFunctionCheck
  • CxxFunctionComplexitySquidSensor
  • CxxFunctionSizeSquidSensor

solution: calculate only once and store this metric
in CxxMetric.LINES_OF_CODE_IN_FUNCION_BODY


This change is Reviewable

@ivangalkin ivangalkin requested review from Bertk and guwirth and removed request for Bertk June 21, 2018 14:34
@ivangalkin
Copy link
Contributor Author

see discussion in #1502 with @guwirth and @ericlemes

this function is called 3 times for each function declaration
* TooManyLinesOfCodeInFunctionCheck
* CxxFunctionComplexitySquidSensor
* CxxFunctionSizeSquidSensor

solution: calculate only once and store this metric
in CxxMetric.LINES_OF_CODE_IN_FUNCION_BODY
@guwirth guwirth added this to the 1.1 milestone Jun 22, 2018
@guwirth
Copy link
Collaborator

guwirth commented Jun 22, 2018

@ivangalkin waiting for final testing.
@ericlemes please do also a review.

Copy link
Contributor

@ericlemes ericlemes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok for me. Just caching the number of lines which is definitely a good thing to do.

@guwirth guwirth merged commit 6a44b24 into SonarOpenCommunity:master Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants