Skip to content

Commit 975c916

Browse files
mcolMichaelChirico
andauthored
Make the message from cyclocomp_linter() more actionable (#2953)
* Make the message from cyclocomp_linter() more actionable. * Revert output changes. --------- Co-authored-by: Michael Chirico <[email protected]>
1 parent eaf3aae commit 975c916

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/cyclocomp_linter.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ cyclocomp_linter <- function(complexity_limit = 15L) {
4545
column_number = source_expression[["column"]][1L],
4646
type = "style",
4747
message = sprintf(
48-
"Reduce the cyclomatic complexity of this expression from %d to at most %d.",
49-
complexity, complexity_limit
48+
"Reduce the cyclomatic complexity of this expression from %d to at most %d. %s",
49+
complexity, complexity_limit,
50+
"Consider replacing high-complexity sections like loops and branches with helper functions."
5051
),
5152
ranges = list(rep(col1, 2L)),
5253
line = source_expression$lines[1L]

0 commit comments

Comments
 (0)