wearefine/maximus

View on GitHub
lib/maximus/lint.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Method relevant_output has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

      def relevant_output(lint, files)
        all_files = {}
        files.each do |file|

          # sometimes data will be blank but this is good - it means no errors were raised in the lint
Severity: Minor
Found in lib/maximus/lint.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method parse_data has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def parse_data(data)
        # Prevent abortive empty JSON.parse error
        data = '{}' if data.blank?

        return "Error from #{@task}: #{data}" if data.is_a?(String) && data.include?('No such')
Severity: Minor
Found in lib/maximus/lint.rb - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method evaluate_severities has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def evaluate_severities(data)
        @output[:lint_warnings] = []
        @output[:lint_errors] = []
        @output[:lint_conventions] = []
        @output[:lint_refactors] = []
Severity: Minor
Found in lib/maximus/lint.rb - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

There are no issues that match your filters.

Category
Status