Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Jan 8, 2025
1 parent 6c8b321 commit 71beb58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/tools/vvet/analysis.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const infixexpr_cutoff = 5
const selectorexpr_cutoff = 10
const callexpr_cutoff = 10

const long_fns_cutoff = 300

struct VetAnalysis {
mut:
repeated_expr_cutoff shared map[string]int // repeated code cutoff
Expand Down Expand Up @@ -69,7 +71,7 @@ fn (mut vt Vet) long_or_empty_fns(fn_decl ast.FnDecl) {
} else {
fn_decl.stmts.last().pos.line_nr - fn_decl.pos.line_nr
}
if nr_lines > 300 {
if nr_lines > long_fns_cutoff {
vt.notice('Long function - ${nr_lines} lines long.', fn_decl.pos.line_nr, .long_fns)
} else if nr_lines == 0 {
vt.notice('Empty function.', fn_decl.pos.line_nr, .empty_fn)
Expand Down

0 comments on commit 71beb58

Please sign in to comment.