moser/foxtrot_mike

View on GitHub
autospec.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Avoid deeply nested control flow statements.
Open

            elsif l =~ /([0-9]*) examples*, 0 failures/
              `notify-send --hint=int:transient:1 '#{$1} example#{$1 == "1" ? "" : "s"} passed' -i ~/code/foxtrot_mike/.notify-img/passed.png &> /dev/null`
              notified = true
              if @run_all_when_green && ((DateTime.now - @last_time_all) * 1440) > 5 #only run all after green every 5 minutes
                #@run_all = true 
Severity: Major
Found in autospec.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                  if @run_all_when_green 
                    #@run_all = true 
                    @run_all_when_green = false
                  end
    Severity: Major
    Found in autospec.rb - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                    `notify-send --hint=int:transient:1 '#{$1} example#{$1 == "1" ? "" : "s"}, #{$2} pending' -i ~/code/foxtrot_mike/.notify-img/pending.png &> /dev/null`
      Severity: Major
      Found in autospec.rb - About 45 mins to fix

        Method build_mtimes_hash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def build_mtimes_hash(globs, first)
          files = @files || {}
          globs.each { |g|
            Dir[g].each { |file| files[file] = first ? File.mtime(file) : (files[file] || (Time.now - 86400)) }
          }
        Severity: Minor
        Found in autospec.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