mrackwitz/CLIntegracon

View on GitHub

Showing 5 of 5 total issues

Method file_spec has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def file_spec(spec_dir, based_on: nil, &block)
      raise ArgumentError.new("Spec directory is missing!") if spec_dir.nil?

      shared_name = spec_dir

Severity: Minor
Found in lib/CLIntegracon/adapter/bacon.rb - About 1 hr to fix

    Method compare has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def compare(&diff_block)
          # Get a copy of the outputs before any transformations are applied
          FileUtils.cp_r("#{temp_transformed_path}/.", temp_raw_path)
    
          transform_paths!
    Severity: Minor
    Found in lib/CLIntegracon/file_tree_spec.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 file_spec has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def file_spec(spec_dir, based_on: nil, &block)
          raise ArgumentError.new("Spec directory is missing!") if spec_dir.nil?
    
          shared_name = spec_dir
    
    
    Severity: Minor
    Found in lib/CLIntegracon/adapter/bacon.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

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

          def transform_paths!
            glob_all.each do |path|
              context.transformers_for(path).each do |transformer|
                transformer.call(path) if path.exist?
              end
    Severity: Minor
    Found in lib/CLIntegracon/file_tree_spec.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

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

        def select_matching_file_patterns(patterns, path)
          patterns.select do |pattern|
            if pattern.is_a?(Regexp)
              path.to_s.match(pattern)
            else
    Severity: Minor
    Found in lib/CLIntegracon/file_tree_spec_context.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