akissa/vagrant-rimu

View on GitHub

Showing 10 of 22 total issues

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

      def finalize!
        @api_key = ENV['RIMU_API_KEY'] if @api_key == UNSET_VALUE
        @api_url = ENV['RIMU_URL'] if @api_url == UNSET_VALUE
        @distro_code = "centos6.64" if @distro_code == UNSET_VALUE
        @disk_space_mb = 20000 if @disk_space_mb == UNSET_VALUE
Severity: Minor
Found in lib/vagrant-rimu/config.rb - About 2 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 execute has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def execute(env)
          client = env[:rimu_api]
          env[:ui].info I18n.t('vagrant_rimu.creating')
          params = {
            :billing_oid => @machine.provider_config.billing_id,
Severity: Major
Found in lib/vagrant-rimu/actions/create.rb - About 2 hrs to fix

    Method execute has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

            def execute(env)
              client = env[:rimu_api]
              env[:ui].info I18n.t('vagrant_rimu.creating')
              params = {
                :billing_oid => @machine.provider_config.billing_id,
    Severity: Minor
    Found in lib/vagrant-rimu/actions/create.rb - About 2 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 execute has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def execute(env)
              client = env[:rimu_api]
              env[:ui].info I18n.t('vagrant_rimu.rebuilding')
              
              params = {
    Severity: Minor
    Found in lib/vagrant-rimu/actions/rebuild.rb - About 1 hr to fix

      Method execute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

              def execute(env)
                client = env[:rimu_api]
                env[:ui].info I18n.t('vagrant_rimu.rebuilding')
                
                params = {
      Severity: Minor
      Found in lib/vagrant-rimu/actions/rebuild.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 validate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

            def validate(machine)
              errors = []
              errors << I18n.t('vagrant_rimu.config.api_key') unless @api_key
              errors << I18n.t('vagrant_rimu.config.host_name') unless @host_name
              if @host_name
      Severity: Minor
      Found in lib/vagrant-rimu/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 action_destroy has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

            def self.action_destroy
              new_builder.tap do |b|
                b.use Call, DestroyConfirm do |env, b1|
                  if env[:result]
                    b1.use ConfigValidate
      Severity: Minor
      Found in lib/vagrant-rimu/actions.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 execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

              def execute(env)
                client = env[:rimu_api]
      
                env[:ui].info I18n.t('vagrant_rimu.moving')
      
      
      Severity: Minor
      Found in lib/vagrant-rimu/actions/move.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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

              def execute(env)
                # check if provisioning is enabled
                enabled = true
                enabled = env[:provision_enabled] if env.has_key?(:provision_enabled)
                return @app.call(env) unless enabled
      Severity: Minor
      Found in lib/vagrant-rimu/actions/modify_provision_path.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 init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def self.init
              level = nil
              begin
                level = Log4r.const_get(ENV['VAGRANT_LOG'].upcase)
              rescue NameError
      Severity: Minor
      Found in lib/vagrant-rimu/logging.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