From 75471f2c275872fdd85017c353a9d8378d781e16 Mon Sep 17 00:00:00 2001 From: Alex Kohler Date: Mon, 23 Apr 2018 09:55:21 -0400 Subject: [PATCH] #759 Codeclimate config (#843) * Initial stab at CodeClimate configuration file * Enabling everything to analyze usefulness of output * Disabling some useless metrics * Ignore static directory * Disable similar code metric * Exclude identical code in test files * glob * Reduce max file lines to 750 * Fix exclude pattern * Exclude t/ * Up max file length + remove t directory * Ignore t/ directory only for identical code metrics * Exlcude patterns to exclude paths * testing * more testing * reindent * Revert back to excluding t directory --- .codeclimate.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .codeclimate.yml diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 000000000..87d7021fc --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,44 @@ +version: "2" # required to adjust maintainability checks +checks: + # Methods or functions defined with a high number of arguments + argument-count: + config: + threshold: 6 + # Boolean logic that may be hard to understand + complex-logic: + config: + threshold: 4 + # Excessive lines of code within a single file + file-lines: + config: + threshold: 900 + # Functions or methods that may be hard to understand. This is disabled as it doesn't appear to be a reliable metric. + method-complexity: + enabled: false + # Classes defined with a high number of functions or methods. + method-count: + config: + threshold: 20 + # Excessive lines of code within a single function or method + method-lines: + config: + threshold: 500 + # Deeply nested control structures like if or case + nested-control-flow: + config: + threshold: 4 + # Functions or methods with a high number of return statements. This is disabled because Go encourages early returns. + return-statements: + enabled: false + # Duplicate code which is not identical but shares the same structure (e.g. variable names may differ). This is disabled due to too many false trips. + similar-code: + enabled: false + # Code that is identical in structure + identical-code: + config: + threshold: # language-specific defaults. an override will affect all languages. +exclude_patterns: + - vendor/ + - static/ + - t/ + \ No newline at end of file