cloudamatic/mu

View on GitHub

Showing 255 of 2,705 total issues

Method processReference has a Cognitive Complexity of 250 (exceeds 75 allowed). Consider refactoring.
Open

      def self.processReference(vpc_block, parent_type, parent, configurator, sibling_vpcs: [], dflt_region: MU.curRegion, dflt_project: nil, credentials: nil)

        if !vpc_block.is_a?(Hash) and vpc_block.kind_of?(MU::Cloud::VPC)
          return true
        end
Severity: Minor
Found in modules/mu/config/vpc.rb - About 3 days 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

File server.rb has 1941 lines of code (exceeds 1000 allowed). Consider refactoring.
Open

require 'net/ssh'
require 'net/ssh/multi'
require 'net/ssh/proxy/command'
autoload :OpenStruct, "ostruct"
autoload :Timeout, "timeout"
Severity: Major
Found in modules/mu/providers/aws/server.rb - About 3 days to fix

    Method dependencies has a Cognitive Complexity of 220 (exceeds 75 allowed). Consider refactoring.
    Open

            def dependencies(use_cache: false, debug: false)
              @dependencies ||= {}
              @loadbalancers ||= []
              @firewall_rules ||= []
    
    
    Severity: Minor
    Found in modules/mu/cloud/resource_base.rb - About 3 days 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

    File container_cluster.rb has 1773 lines of code (exceeds 1000 allowed). Consider refactoring.
    Open

    module MU
      class Cloud
        class AWS
          # A ContainerCluster as configured in {MU::Config::BasketofKittens::container_clusters}
          class ContainerCluster < MU::Cloud::ContainerCluster
    Severity: Major
    Found in modules/mu/providers/aws/container_cluster.rb - About 2 days to fix

      Method schema has 613 lines of code (exceeds 150 allowed). Consider refactoring.
      Open

              def self.schema(_config)
                toplevel_required = []
      
                schema = {
                  "flavor" => {
      Severity: Major
      Found in modules/mu/providers/aws/container_cluster.rb - About 2 days to fix

        Method initialize has a Cognitive Complexity of 175 (exceeds 75 allowed). Consider refactoring.
        Open

                def initialize(**args)
                  raise MuError, "Cannot invoke Cloud objects without a configuration" if args[:kitten_cfg].nil?
        
                  # We are a parent wrapper object. Initialize our child object and
                  # housekeeping bits accordingly.
        Severity: Minor
        Found in modules/mu/cloud/resource_base.rb - About 2 days 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 method_missing has a Cognitive Complexity of 171 (exceeds 75 allowed). Consider refactoring.
        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 - About 2 days 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 create has 491 lines of code (exceeds 150 allowed). Consider refactoring.
        Open

                def create
                  if @config["zones"] == nil
                    @config["zones"] = MU::Cloud::AWS.listAZs(region: @region)
                    MU.log "Using zones from #{@region}", MU::DEBUG, details: @config['zones']
                  end
        Severity: Major
        Found in modules/mu/providers/aws/loadbalancer.rb - About 1 day to fix

          Method insertKitten has a Cognitive Complexity of 159 (exceeds 75 allowed). Consider refactoring.
          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 - About 1 day 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

          File vpc.rb has 1493 lines of code (exceeds 1000 allowed). Consider refactoring.
          Open

          module MU
            class Cloud
              class AWS
          
                # Creation of Virtual Private Clouds and associated artifacts (routes, subnets, etc).
          Severity: Major
          Found in modules/mu/providers/aws/vpc.rb - About 1 day to fix

            Method create has a Cognitive Complexity of 152 (exceeds 75 allowed). Consider refactoring.
            Open

                    def create
                      if @config["zones"] == nil
                        @config["zones"] = MU::Cloud::AWS.listAZs(region: @region)
                        MU.log "Using zones from #{@region}", MU::DEBUG, details: @config['zones']
                      end
            Severity: Minor
            Found in modules/mu/providers/aws/loadbalancer.rb - About 1 day 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 toKitten has a Cognitive Complexity of 150 (exceeds 75 allowed). Consider refactoring.
            Open

                    def toKitten(**args)
            
                      bok = {
                        "cloud" => "Google",
                        "credentials" => @config['credentials'],
            Severity: Minor
            Found in modules/mu/providers/google/role.rb - About 1 day 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

            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

              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

                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

                  Method printSchema has a Cognitive Complexity of 135 (exceeds 75 allowed). Consider refactoring.
                  Open

                      def self.printSchema(kitten_rb, class_hierarchy, schema, in_array = false, required = false, prefix: nil)
                        return if schema.nil?
                  
                        if schema["type"] == "object"
                          printme = []
                  Severity: Minor
                  Found in modules/mu/config/doc_helpers.rb - About 1 day 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 validateConfig has a Cognitive Complexity of 129 (exceeds 75 allowed). Consider refactoring.
                  Open

                          def self.validateConfig(pool, configurator)
                            ok = true
                  
                            if pool["termination_policy"]
                              valid_policies = MU::Cloud::AWS.autoscale(region: pool['region']).describe_termination_policy_types.termination_policy_types
                  Severity: Minor
                  Found in modules/mu/providers/aws/server_pool.rb - About 1 day 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 common_properties has 354 lines of code (exceeds 150 allowed). Consider refactoring.
                  Open

                        def self.common_properties
                          {
                            "name" => {"type" => "string"},
                            "ansible_vars" => {
                              "type" => "object",
                  Severity: Major
                  Found in modules/mu/config/server.rb - About 1 day to fix

                    Method processReference has 352 lines of code (exceeds 150 allowed). Consider refactoring.
                    Open

                          def self.processReference(vpc_block, parent_type, parent, configurator, sibling_vpcs: [], dflt_region: MU.curRegion, dflt_project: nil, credentials: nil)
                    
                            if !vpc_block.is_a?(Hash) and vpc_block.kind_of?(MU::Cloud::VPC)
                              return true
                            end
                    Severity: Major
                    Found in modules/mu/config/vpc.rb - About 1 day to fix

                      Method cloudFormationBase has 351 lines of code (exceeds 150 allowed). Consider refactoring.
                      Open

                            def self.cloudFormationBase(type, cloudobj = nil, name: nil, tags: [], scrub_mu_isms: false)
                              desc = {}
                              tags = [] if tags.nil?
                              realtags = []
                              havenametag = false
                      Severity: Major
                      Found in modules/mu/providers/cloudformation.rb - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language