dsawardekar/speckle

View on GitHub

Showing 5 of 5 total issues

Method load has 119 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def load(args)
        options = OpenStruct.new
        options.libs = nil
        options.grep_pattern = nil
        options.grep_invert = false
Severity: Major
Found in lib/speckle/cli/environment.rb - About 4 hrs to fix

    Method load has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

          def load(args)
            options = OpenStruct.new
            options.libs = nil
            options.grep_pattern = nil
            options.grep_invert = false
    Severity: Minor
    Found in lib/speckle/cli/environment.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 build_riml_path has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

          def build_riml_path(dirs, pattern = /.*\.riml$/, spec_pattern = /.*_spec\.riml$/)
            libs = []
            dirs.each do |dir|
              if File.directory?(dir)
                Find.find(dir) do |path|
    Severity: Minor
    Found in lib/speckle/cli/environment.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 rake_env has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

          def rake_env(key, value)
            unless value.nil?
              ENV[key] = if value.is_a?(Array) then value.join(';') else value end
              puts "rake_env: #{key} = #{ENV[key]}" if debug
            end
    Severity: Minor
    Found in lib/speckle/cli/rake_app.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 get_builder has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

          def get_builder
            if @source_builder.nil?
              @source_builder = Speckle::List::Builder.new
              @options.inputs.each do |input|
                @source_builder.add_source input
    Severity: Minor
    Found in lib/speckle/cli/rake_app.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

    Severity
    Category
    Status
    Source
    Language