tily/barthes

View on GitHub
lib/barthes/runner.rb

Summary

Maintainability
A
3 hrs
Test Coverage

Method walk_json has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        def walk_json(json, scenarios)
            if json.class == Array
                case json.first
                when 'scenario'
                    handle_scenario(json, scenarios)
Severity: Minor
Found in lib/barthes/runner.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 handle_action has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        def handle_action(action, scenarios)
            return if @failed
            name, content = action[1], action.last
            env = @env.dup
            env.update(content['env']) if content['env']
Severity: Minor
Found in lib/barthes/runner.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 tagged? has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def tagged?(env)
            return true if Barthes::Config[:tags].nil? && Barthes::Config[:'no-tags'].nil?
            tags = env['tags'] || []
            if Barthes::Config[:tags].nil?
                if (Barthes::Config[:'no-tags'] & tags).size > 0
Severity: Minor
Found in lib/barthes/runner.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 expand_paths has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def expand_paths(paths, suffix)
            files = []
            if paths.empty?
                files += Dir["./**/*#{suffix}"]
            else
Severity: Minor
Found in lib/barthes/runner.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