cornelius/yes_ship_it

View on GitHub

Showing 10 of 24 total issues

File cli_spec.rb has 324 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require_relative "spec_helper"

include CliTester
include GivenFilesystemSpecHelpers

Severity: Minor
Found in spec/integration/cli_spec.rb - About 3 hrs to fix

    Method run has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        def run
          failed_assertions = []
          errored_assertions = []
          skipped_assertions = []
    
    
    Severity: Minor
    Found in lib/yes_ship_it/engine.rb - About 3 hrs 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 run has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def run
          failed_assertions = []
          errored_assertions = []
          skipped_assertions = []
    
    
    Severity: Major
    Found in lib/yes_ship_it/engine.rb - About 2 hrs to fix

      Method parse has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          def parse(config)
            config.each do |key,value|
              if key == "include"
                included_file = value
                configs_path = File.expand_path("../../../configs", __FILE__)
      Severity: Minor
      Found in lib/yes_ship_it/engine.rb - About 2 hrs 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 setup_config has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def setup_config
            config_file = File.join(@path, "yes_ship_it.conf")
      
            if File.exist?(config_file)
              out.puts "There already is a file `yes_ship_it.conf`."
      Severity: Minor
      Found in lib/yes_ship_it/init.rb - About 1 hr to fix

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

            def parse_version(file_name)
              if file_name =~ /\.rb$/
                File.read(file_name).each_line do |line|
                  if line =~ /VERSION = ['"](.*)['"]/
                    return $1
        Severity: Minor
        Found in assertions/version.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 check has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def check
              if !obs_project
                raise AssertionError.new("OBS project is not set")
              end
              if !engine.release_archive
        Severity: Minor
        Found in assertions/submitted_rpm.rb - About 1 hr to fix

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

              def check
                if !obs_project
                  raise AssertionError.new("OBS project is not set")
                end
                if !engine.release_archive
          Severity: Minor
          Found in assertions/submitted_rpm.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 status has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def status
                if !@status
                  g = git_status
                  if g =~ /working directory clean/
                    @status = "clean"
          Severity: Minor
          Found in assertions/working_directory.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 assert has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def assert(executor)
                engine.out.puts "..."
          
                old_files = []
                @obs_package_files.each do |file|
          Severity: Minor
          Found in assertions/submitted_rpm.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

          Severity
          Category
          Status
          Source
          Language