cloudamatic/mu

View on GitHub

Showing 2,704 of 2,705 total issues

Assignment Branch Condition size for toKitten is too high. [167.5/75]
Open

        def toKitten(**_args)
          bok = {
            "cloud" => "AWS",
            "region" => @region,
            "credentials" => @credentials,

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for toKitten is too high. [166.3/75]
Open

      def toKitten(**_args)
        bok = {
          "cloud" => "AWS",
          "credentials" => @credentials,
          "cloud_id" => @cloud_id,
Severity: Minor
Found in modules/mu/providers/aws/server.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for peerWith is too high. [166.7/75]
Open

        def peerWith(peer)
          peer_ref = MU::Config::Ref.get(peer['vpc'])
          peer_obj = peer_ref.kitten
          if !peer_obj
            raise MuError.new "#{@mu_name}: Failed to locate my peer VPC", details: peer_ref.to_h
Severity: Minor
Found in modules/mu/providers/aws/vpc.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

File database.rb has 1412 lines of code (exceeds 1000 allowed). Consider refactoring.
Open

autoload :Net, 'net/ssh/gateway'

module MU
  class Cloud
    class AWS
Severity: Major
Found in modules/mu/providers/aws/database.rb - About 1 day to fix

    Block has too many lines. [238/100]
    Open

    app = proc do |env|
      returnval = [
          200,
          {
              'Content-Type' => 'text/html',
    Severity: Minor
    Found in modules/mommacat.ru by rubocop

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Assignment Branch Condition size for validateConfig is too high. [161.9/75]
    Open

            def self.validateConfig(server, configurator)
              ok = true
    
              server['project'] ||= MU::Cloud::Google.defaultProject(server['credentials'])
    
    

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Assignment Branch Condition size for create is too high. [161.1/75]
    Open

            def create
              @cfm_name, @cfm_template = MU::Cloud::CloudFormation.cloudFormationBase("dnszone", self, scrub_mu_isms: @config['scrub_mu_isms'])
              MU::Cloud::CloudFormation.setCloudFormationProp(@cfm_template[@cfm_name], "Name", @config['name'])
              MU::Cloud::CloudFormation.setCloudFormationProp(@cfm_template[@cfm_name], "HostedZoneConfig", { "Comment" => MU.deploy_id })
    
    

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Assignment Branch Condition size for buildOptionsHash is too high. [158.1/75]
    Open

            def buildOptionsHash
              asg_options = {
                :auto_scaling_group_name => @mu_name,
                :launch_configuration_name => @mu_name,
                :default_cooldown => @config["default_cooldown"],

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Method has too many lines. [282/200]
    Open

        def insertKitten(descriptor, type, delay_validation = false, ignore_duplicates: false, overwrite: false)
          append = false
          start = Time.now
    
          shortclass, cfg_name, cfg_plural, classname = MU::Cloud.getResourceNames(type)
    Severity: Minor
    Found in modules/mu/config.rb by rubocop

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Assignment Branch Condition size for manageRecord is too high. [156.8/75]
    Open

            def self.manageRecord(id, name, type, targets: nil,
                ttl: 7200, delete: false, sync_wait: true, failover: nil,
                healthcheck: nil, region: nil, weight: nil, overwrite: true,
                location: nil, set_identifier: nil, alias_zone: nil, noop: false)
    
    
    Severity: Minor
    Found in modules/mu/providers/aws/dnszone.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Assignment Branch Condition size for create is too high. [156.2/75]
    Open

            def create
              @cfm_name, @cfm_template = MU::Cloud::CloudFormation.cloudFormationBase(self.class.cfg_name, self, tags: @config['tags'], scrub_mu_isms: @config['scrub_mu_isms']) if @cfm_template.nil?
              if @config['override_name']
                MU::Cloud::CloudFormation.setCloudFormationProp(@cfm_template[@cfm_name], "LoadBalancerName", @config['override_name'])
              else

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Assignment Branch Condition size for search_my_deploys is too high. [156.8/75]
    Open

        def self.search_my_deploys(type, deploy_id: nil, name: nil, mu_name: nil, cloud_id: nil, credentials: nil)
          kittens = {}
          _shortclass, _cfg_name, type, _classname, attrs = MU::Cloud.getResourceNames(type, true)
    
          # Check our in-memory cache of live deploys before resorting to
    Severity: Minor
    Found in modules/mu/mommacat/search.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Class AWS has 74 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class AWS
          @@myRegion_var = nil
    
          @@creds_loaded = {}
    
    
    Severity: Major
    Found in modules/mu/providers/aws.rb - About 1 day to fix

      Perceived complexity for method_missing is too high. [115/35]
      Open

              def method_missing(method_sym, *arguments)
                retries = 0
                actual_resource = nil
      
                enable_on_fail = true
      Severity: Minor
      Found in modules/mu/providers/google.rb by rubocop

      This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

      Example:

      def my_method                   # 1
        if cond                       # 1
          case var                    # 2 (0.8 + 4 * 0.2, rounded)
          when 1 then func_one
          when 2 then func_two
          when 3 then func_three
          when 4..10 then func_other
          end
        else                          # 1
          do_something until a && b   # 2
        end                           # ===
      end                             # 7 complexity points

      Assignment Branch Condition size for create is too high. [155.6/75]
      Open

              def create
                @config["snapshot_id"] =
                  if @config["creation_style"] == "existing_snapshot"
                    getExistingSnapshot ? getExistingSnapshot : createNewSnapshot
                  elsif @config["creation_style"] == "new_snapshot"

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

      Assignment Branch Condition size for validateConfig is too high. [155.7/75]
      Open

              def self.validateConfig(endpoint, configurator)
                ok = true
      
                if endpoint['log_requests'] and !endpoint['access_logs']
                  logdesc = {

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

      Assignment Branch Condition size for groom is too high. [154.4/75]
      Open

              def groom
                desc = {}
      
                func_obj = buildDesc
      
      

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

      Assignment Branch Condition size for docSchema is too high. [154.9/75]
      Open

          def self.docSchema
            docschema = Marshal.load(Marshal.dump(@@schema))
            only_children = {}
            MU::Cloud.resource_types.each_pair { |classname, attrs|
              MU::Cloud.supportedClouds.each { |cloud|
      Severity: Minor
      Found in modules/mu/config/doc_helpers.rb by rubocop

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

      Assignment Branch Condition size for toKitten is too high. [153.8/75]
      Open

              def toKitten(**_args)
                bok = {
                  "cloud" => "Google",
                  "credentials" => @credentials,
                  "cloud_id" => @cloud_id,

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

      File aws.rb has 1356 lines of code (exceeds 1000 allowed). Consider refactoring.
      Open

      require "net/http"
      require 'open-uri'
      require 'timeout'
      require 'inifile'
      autoload :Aws, "aws-sdk-core"
      Severity: Major
      Found in modules/mu/providers/aws.rb - About 1 day to fix
        Severity
        Category
        Status
        Source
        Language