cloudamatic/mu

View on GitHub

Showing 255 of 2,705 total issues

Class VPC has 39 methods (exceeds 20 allowed). Consider refactoring.
Open

      class VPC < MU::Cloud::VPC
        require 'mu/providers/aws/vpc_subnet'

        # Initialize this cloud resource object. Calling +super+ will invoke the initializer defined under {MU::Cloud}, which should set the attribtues listed in {MU::Cloud::PUBLIC_ATTRS} as well as applicable dependency shortcuts, like +@vpc+, for us.
        # @param args [Hash]: Hash of named arguments passed via Ruby's double-splat
Severity: Minor
Found in modules/mu/providers/aws/vpc.rb - About 5 hrs to fix

    Method validate has a Cognitive Complexity of 104 (exceeds 75 allowed). Consider refactoring.
    Open

          def self.validate(vpc, configurator)
            ok = true
    
            have_public = false
            have_private = false
    Severity: Minor
    Found in modules/mu/config/vpc.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

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

    module MU
      class Cloud
        class Google
          # A Kubernetes cluster as configured in {MU::Config::BasketofKittens::container_clusters}
          class ContainerCluster < MU::Cloud::ContainerCluster
    Severity: Major
    Found in modules/mu/providers/google/container_cluster.rb - About 4 hrs to fix

      Method records_primitive has 245 lines of code (exceeds 150 allowed). Consider refactoring.
      Open

            def self.records_primitive(need_target: true, default_type: nil, need_zone: false, embedded_type: nil)
              dns_records_primitive = {
                "type" => "array",
                "maxItems" => 100,
                "items" => {
      Severity: Major
      Found in modules/mu/config/dnszone.rb - About 4 hrs to fix

        File role.rb has 1114 lines of code (exceeds 1000 allowed). Consider refactoring.
        Open

        module MU
          class Cloud
            class AWS
              # A user as configured in {MU::Config::BasketofKittens::roles}
              class Role < MU::Cloud::Role
        Severity: Major
        Found in modules/mu/providers/aws/role.rb - About 4 hrs to fix

          Method dependencies has 243 lines of code (exceeds 150 allowed). Consider refactoring.
          Open

                  def dependencies(use_cache: false, debug: false)
                    @dependencies ||= {}
                    @loadbalancers ||= []
                    @firewall_rules ||= []
          
          
          Severity: Major
          Found in modules/mu/cloud/resource_base.rb - About 4 hrs to fix

            Method genParams has a Cognitive Complexity of 99 (exceeds 75 allowed). Consider refactoring.
            Open

                    def genParams(ext = nil)
                      params = {
                        :domain_name => @config['domain_name'] || @deploydata['domain_name']
                      }
            
            
            Severity: Minor
            Found in modules/mu/providers/aws/search_domain.rb - About 4 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 writeCloudFormationTemplate has 231 lines of code (exceeds 150 allowed). Consider refactoring.
            Open

                  def self.writeCloudFormationTemplate(tails: MU::Config.tails, config: {}, path: nil, mommacat: nil)
                    cfm_template = {
                      "AWSTemplateFormatVersion" => "2010-09-09",
                      "Description" =>  "Automatically generated by Mu",
                      "Parameters" => {
            Severity: Major
            Found in modules/mu/providers/cloudformation.rb - About 4 hrs to fix

              Method run has 227 lines of code (exceeds 150 allowed). Consider refactoring.
              Open

                  def run
                    Signal.trap("INT") do
                      # Don't use MU.log in here, it does a synchronize {} and that ain't
                      # legal inside a trap.
                      die = true if (Time.now.to_i - @last_sigterm) < 5
              Severity: Major
              Found in modules/mu/deploy.rb - About 4 hrs to fix

                Method create_update has 226 lines of code (exceeds 150 allowed). Consider refactoring.
                Open

                        def create_update
                          @config = MU::Config.manxify(@config)
                          @config['region'] ||= MU::Cloud::Azure.myRegion(@config['credentials'])
                          tags = {}
                          if !@config['scrub_mu_isms']
                Severity: Major
                Found in modules/mu/providers/azure/vpc.rb - About 4 hrs to fix

                  Method writeCloudFormationTemplate has a Cognitive Complexity of 96 (exceeds 75 allowed). Consider refactoring.
                  Open

                        def self.writeCloudFormationTemplate(tails: MU::Config.tails, config: {}, path: nil, mommacat: nil)
                          cfm_template = {
                            "AWSTemplateFormatVersion" => "2010-09-09",
                            "Description" =>  "Automatically generated by Mu",
                            "Parameters" => {
                  Severity: Minor
                  Found in modules/mu/providers/cloudformation.rb - About 3 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 groom has a Cognitive Complexity of 96 (exceeds 75 allowed). Consider refactoring.
                  Open

                          def groom
                            if @config['notifications'] and @config['notifications']['topic']
                  # XXX expand to a full reference block for a Notification resource
                              arn = if @config['notifications']['topic'].match(/^arn:/)
                                @config['notifications']['topic']
                  Severity: Minor
                  Found in modules/mu/providers/aws/server_pool.rb - About 3 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 findLitterMate has a Cognitive Complexity of 96 (exceeds 75 allowed). Consider refactoring.
                  Open

                      def findLitterMate(type: nil, name: nil, mu_name: nil, cloud_id: nil, created_only: false, return_all: false, credentials: nil, habitat: nil, ignore_missing: false, debug: false, **flags)
                        _shortclass, _cfg_name, type, _classname, attrs = MU::Cloud.getResourceNames(type)
                  
                        # If we specified a habitat, which we may also have done by its shorthand
                        # sibling name, or a Ref. Convert to something we can use.
                  Severity: Minor
                  Found in modules/mu/mommacat/search.rb - About 3 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

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

                      class Chef
                  
                        Object.class_eval {
                          def self.const_missing(symbol)
                            if symbol.to_sym == :Chef or symbol.to_sym == :ChefVault
                  Severity: Minor
                  Found in modules/mu/groomers/chef.rb - About 3 hrs to fix

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

                            def self.schema(_config)
                              toplevel_required = []
                              schema = {
                                "domain_names" => {
                                  "type" => "array",
                    Severity: Major
                    Found in modules/mu/providers/aws/endpoint.rb - About 3 hrs to fix

                      Class VPC has 29 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                            class VPC < MU::Cloud::VPC
                              attr_reader :cloud_desc_cache
                              attr_reader :routes
                      
                              # Initialize this cloud resource object. Calling +super+ will invoke the initializer defined under {MU::Cloud}, which should set the attribtues listed in {MU::Cloud::PUBLIC_ATTRS} as well as applicable dependency shortcuts, like <tt>@vpc</tt>, for us.
                      Severity: Minor
                      Found in modules/mu/providers/google/vpc.rb - About 3 hrs to fix

                        Method validateConfig has a Cognitive Complexity of 94 (exceeds 75 allowed). Consider refactoring.
                        Open

                                def self.validateConfig(vpc, configurator)
                                  ok = true
                        
                                  if vpc["enable_traffic_logging"]
                                    logdesc = {
                        Severity: Minor
                        Found in modules/mu/providers/aws/vpc.rb - About 3 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 run has a Cognitive Complexity of 94 (exceeds 75 allowed). Consider refactoring.
                        Open

                            def run
                              Signal.trap("INT") do
                                # Don't use MU.log in here, it does a synchronize {} and that ain't
                                # legal inside a trap.
                                die = true if (Time.now.to_i - @last_sigterm) < 5
                        Severity: Minor
                        Found in modules/mu/deploy.rb - About 3 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

                        Class Server has 28 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                              class Server < MU::Cloud::Server
                        
                                # Initialize this cloud resource object. Calling +super+ will invoke the initializer defined under {MU::Cloud}, which should set the attribtues listed in {MU::Cloud::PUBLIC_ATTRS} as well as applicable dependency shortcuts, like <tt>@vpc</tt>, for us.
                                # @param args [Hash]: Hash of named arguments passed via Ruby's double-splat
                                def initialize(**args)
                        Severity: Minor
                        Found in modules/mu/providers/google/server.rb - About 3 hrs to fix

                          Class ContainerCluster has 28 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                                class ContainerCluster < MU::Cloud::ContainerCluster
                          
                          
                                  # Initialize this cloud resource object. Calling +super+ will invoke the initializer defined under {MU::Cloud}, which should set the attribtues listed in {MU::Cloud::PUBLIC_ATTRS} as well as applicable dependency shortcuts, like +@vpc+, for us.
                                  # @param args [Hash]: Hash of named arguments passed via Ruby's double-splat
                          Severity: Minor
                          Found in modules/mu/providers/aws/container_cluster.rb - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language