mohitsethi/vagrant-hp

View on GitHub

Showing 6 of 6 total issues

Method call has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

        def call(env)
          # Get the configs
          config = env[:machine].provider_config

          # Find the flavor
Severity: Minor
Found in lib/vagrant-hp/action/create_server.rb - About 5 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 call has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def call(env)
          # Get the configs
          config = env[:machine].provider_config

          # Find the flavor
Severity: Major
Found in lib/vagrant-hp/action/create_server.rb - About 2 hrs to fix

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

          def finalize!
            # The access keys default to nil
            @access_key = nil if @access_key == UNSET_VALUE
            @secret_key = nil if @secret_key == UNSET_VALUE
            @tenant_id = nil if @tenant_id == UNSET_VALUE
    Severity: Minor
    Found in lib/vagrant-hp/config.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 call has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

            def call(env)
              @app.call(env)
    
              ssh_info = env[:machine].ssh_info
    
    
    Severity: Minor
    Found in lib/vagrant-hp/action/sync_folders.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 find_match has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

            def find_match(collection, name)
              collection.each do |single|
                return single if single.id == name
                return single if single.name == name
                return single if name.is_a?(Regexp) && name =~ single.name
    Severity: Minor
    Found in lib/vagrant-hp/action/create_server.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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def validate(machine)
            errors = []
            warnings = []
            messages = []
    
    
    Severity: Minor
    Found in lib/vagrant-hp/config.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