wearefine/maximus

View on GitHub
lib/maximus/git_control.rb

Summary

Maintainability
B
4 hrs
Test Coverage

Method lints_and_stats has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def lints_and_stats(lint_by_path = false, git_shas = compare, nuclear = false)
      return false if git_shas.blank?

      base_branch = branch
      git_ouput = {}
Severity: Minor
Found in lib/maximus/git_control.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 match_associations has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

      def match_associations(commit_sha, files)
        new_lines = lines_added(commit_sha)

        files = files.split("\n").group_by { |f| f.split('.').pop }

Severity: Minor
Found in lib/maximus/git_control.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 lints_and_stats_switch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def lints_and_stats_switch(ext, lint_opts)
        result = {
          lints: {},
          statistics: {}
        }
Severity: Minor
Found in lib/maximus/git_control.rb - About 35 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 commit_range has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def commit_range(sha1, sha2)
        git_spread = @psuedo_commit ? "git #{sha1}" : sha_range(sha1, sha2)
        git_spread = git_spread.nil? ? [] : git_spread.split("\n")

        git_spread << sha1 unless @psuedo_commit
Severity: Minor
Found in lib/maximus/git_control.rb - About 25 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