Skip to content

Commit

Permalink
nit: replace expression by variable
Browse files Browse the repository at this point in the history
  • Loading branch information
chavacava committed Dec 4, 2024
1 parent a984312 commit cade0b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rule/function_length.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (r *FunctionLength) Apply(file *lint.File, arguments lint.Arguments) []lint
}

if r.maxStmt > 0 {
stmtCount := r.countStmts(funcDecl.Body.List)
stmtCount := r.countStmts(body.List)
if stmtCount > r.maxStmt {
failures = append(failures, lint.Failure{
Confidence: 1,
Expand All @@ -52,7 +52,7 @@ func (r *FunctionLength) Apply(file *lint.File, arguments lint.Arguments) []lint
}

if r.maxLines > 0 {
lineCount := r.countLines(funcDecl.Body, file)
lineCount := r.countLines(body, file)
if lineCount > r.maxLines {
failures = append(failures, lint.Failure{
Confidence: 1,
Expand Down

0 comments on commit cade0b3

Please sign in to comment.