Skip to content
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

cyclocomp_linter() message should be customized to 'function'/'expression' #2680

Open
MichaelChirico opened this issue Oct 28, 2024 · 0 comments

Comments

@MichaelChirico
Copy link
Collaborator

cyclocomp() can measure complexity of functions or expressions, but the message always says "function":

"Reduce the cyclomatic complexity of this function from %d to at most %d.",

This might be confusing if the lint hits a non-function expression:

lint(linters = cyclocomp_linter(5L), "
for (i in 1:10)
  for (j in 1:10)
    for (k in 1:10)
      i*j*k
")
# <text>:2:1: style: [cyclocomp_linter] Reduce the cyclomatic complexity of this function from 10 to at most 5.
# for (i in 1:10)
# ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant