ashmckenzie/percheron

View on GitHub

Showing 5 of 5 total issues

Class Unit has 33 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Unit

    extend Forwardable
    extend ConfigDelegator
    include Unit::ImageHelper
Severity: Minor
Found in lib/percheron/unit.rb - About 4 hrs to fix

    Class Config has 30 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Config
    
        include Singleton
    
        DEFAULT_CONFIG_FILE = '.percheron.yml'
    Severity: Minor
    Found in lib/percheron/config.rb - About 3 hrs to fix

      Class Stack has 24 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Stack
          extend Forwardable
      
          def_delegators :stack_config, :name, :description
      
      
      Severity: Minor
      Found in lib/percheron/stack.rb - About 2 hrs to fix

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

                def create!
                  if create?
                    create_unit!
                    update_dockerfile_md5!
                    start_and_insert_scripts! if start?
        Severity: Minor
        Found in lib/percheron/actions/create.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 node_link_opts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def node_link_opts(unit)
                direction = unit.startable? ? 'forward' : 'none'
                style     = unit.startable? ? 'solid' : 'solid'
                color     = unit.startable? ? 'black' : 'gray'
                { dir: direction, style: style, color: color }
        Severity: Minor
        Found in lib/percheron/graph.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