From 7f081635bdeb19b79563df884d91b41e2d3e1a2b Mon Sep 17 00:00:00 2001 From: illia-romanenko <442086+illia-romanenko@users.noreply.github.com> Date: Tue, 26 Mar 2024 10:54:54 -0400 Subject: [PATCH] Change default value of `cyclomatic_complexity` rule to 10. --- CHANGELOG.md | 2 ++ .../models/cyclomatic_complexity_parameters.dart | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c681581e..1508c64c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ - Fixed unexpected avoid_unnecessary_type_assertions - Added `excludeNames` param for `function_lines_of_code` lint - Improved `avoid_unrelated_type_assertions` to support true and false results +- Set default `cyclomatic_complexity` to 10 (https://github.com/solid-software/solid_lints/issues/146) + Credits: Arthur Miranda (https://github.com/arthurbcd) ## 0.1.4 diff --git a/lib/src/lints/cyclomatic_complexity/models/cyclomatic_complexity_parameters.dart b/lib/src/lints/cyclomatic_complexity/models/cyclomatic_complexity_parameters.dart index ea62870d..3ffa5ae1 100644 --- a/lib/src/lints/cyclomatic_complexity/models/cyclomatic_complexity_parameters.dart +++ b/lib/src/lints/cyclomatic_complexity/models/cyclomatic_complexity_parameters.dart @@ -3,7 +3,8 @@ class CyclomaticComplexityParameters { /// Threshold cyclomatic complexity level, exceeding it triggers a warning. final int maxComplexity; - static const _defaultMaxComplexity = 2; + /// Reference: NIST 500-235 item 2.5 + static const _defaultMaxComplexity = 10; /// Constructor for [CyclomaticComplexityParameters] model const CyclomaticComplexityParameters({