cloudamatic/mu

View on GitHub

Showing 2,704 of 2,705 total issues

Avoid deeply nested control flow statements.
Open

            hashcfg.delete("id") if hashcfg["name"]
Severity: Major
Found in modules/mu/adoption.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    if public
                      # Make sure we have a public IP address to register. Use the private one if we don't
                      server.cloud_desc.public_ip_address ? server.cloud_desc.public_ip_address : server.cloud_desc.private_ip_address
                    else
                      # If we specifically requested to register the private IP lets use that
    Severity: Major
    Found in modules/mu/mommacat/naming.rb - About 45 mins to fix

      Similar blocks of code found in 32 locations. Consider refactoring.
      Open

            def self.waf(region: MU.curRegion, credentials: nil)
              region ||= myRegion
              @@waf[credentials] ||= {}
              @@waf[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "WAFRegional", region: region, credentials: credentials)
              @@waf[credentials][region]
      Severity: Major
      Found in modules/mu/providers/aws.rb and 31 other locations - About 45 mins to fix
      modules/mu/providers/aws.rb on lines 1077..1081
      modules/mu/providers/aws.rb on lines 1091..1095
      modules/mu/providers/aws.rb on lines 1099..1103
      modules/mu/providers/aws.rb on lines 1107..1111
      modules/mu/providers/aws.rb on lines 1115..1119
      modules/mu/providers/aws.rb on lines 1129..1133
      modules/mu/providers/aws.rb on lines 1137..1141
      modules/mu/providers/aws.rb on lines 1145..1149
      modules/mu/providers/aws.rb on lines 1153..1157
      modules/mu/providers/aws.rb on lines 1161..1165
      modules/mu/providers/aws.rb on lines 1169..1173
      modules/mu/providers/aws.rb on lines 1186..1190
      modules/mu/providers/aws.rb on lines 1194..1198
      modules/mu/providers/aws.rb on lines 1202..1206
      modules/mu/providers/aws.rb on lines 1210..1214
      modules/mu/providers/aws.rb on lines 1218..1222
      modules/mu/providers/aws.rb on lines 1226..1230
      modules/mu/providers/aws.rb on lines 1234..1238
      modules/mu/providers/aws.rb on lines 1242..1246
      modules/mu/providers/aws.rb on lines 1250..1254
      modules/mu/providers/aws.rb on lines 1266..1270
      modules/mu/providers/aws.rb on lines 1274..1278
      modules/mu/providers/aws.rb on lines 1282..1286
      modules/mu/providers/aws.rb on lines 1290..1294
      modules/mu/providers/aws.rb on lines 1298..1302
      modules/mu/providers/aws.rb on lines 1306..1310
      modules/mu/providers/aws.rb on lines 1314..1318
      modules/mu/providers/aws.rb on lines 1322..1326
      modules/mu/providers/aws.rb on lines 1330..1334
      modules/mu/providers/aws.rb on lines 1338..1342
      modules/mu/providers/aws.rb on lines 1346..1350

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 40.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 32 locations. Consider refactoring.
      Open

            def self.elasticache(region: MU.curRegion, credentials: nil)
              region ||= myRegion
              @@elasticache_api[credentials] ||= {}
              @@elasticache_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "ElastiCache", region: region, credentials: credentials)
              @@elasticache_api[credentials][region]
      Severity: Major
      Found in modules/mu/providers/aws.rb and 31 other locations - About 45 mins to fix
      modules/mu/providers/aws.rb on lines 1077..1081
      modules/mu/providers/aws.rb on lines 1091..1095
      modules/mu/providers/aws.rb on lines 1099..1103
      modules/mu/providers/aws.rb on lines 1107..1111
      modules/mu/providers/aws.rb on lines 1115..1119
      modules/mu/providers/aws.rb on lines 1129..1133
      modules/mu/providers/aws.rb on lines 1137..1141
      modules/mu/providers/aws.rb on lines 1145..1149
      modules/mu/providers/aws.rb on lines 1153..1157
      modules/mu/providers/aws.rb on lines 1161..1165
      modules/mu/providers/aws.rb on lines 1169..1173
      modules/mu/providers/aws.rb on lines 1178..1182
      modules/mu/providers/aws.rb on lines 1186..1190
      modules/mu/providers/aws.rb on lines 1194..1198
      modules/mu/providers/aws.rb on lines 1202..1206
      modules/mu/providers/aws.rb on lines 1218..1222
      modules/mu/providers/aws.rb on lines 1226..1230
      modules/mu/providers/aws.rb on lines 1234..1238
      modules/mu/providers/aws.rb on lines 1242..1246
      modules/mu/providers/aws.rb on lines 1250..1254
      modules/mu/providers/aws.rb on lines 1266..1270
      modules/mu/providers/aws.rb on lines 1274..1278
      modules/mu/providers/aws.rb on lines 1282..1286
      modules/mu/providers/aws.rb on lines 1290..1294
      modules/mu/providers/aws.rb on lines 1298..1302
      modules/mu/providers/aws.rb on lines 1306..1310
      modules/mu/providers/aws.rb on lines 1314..1318
      modules/mu/providers/aws.rb on lines 1322..1326
      modules/mu/providers/aws.rb on lines 1330..1334
      modules/mu/providers/aws.rb on lines 1338..1342
      modules/mu/providers/aws.rb on lines 1346..1350

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 40.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 32 locations. Consider refactoring.
      Open

            def self.sns(region: MU.curRegion, credentials: nil)
              region ||= myRegion
              @@sns_api[credentials] ||= {}
              @@sns_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "SNS", region: region, credentials: credentials)
              @@sns_api[credentials][region]
      Severity: Major
      Found in modules/mu/providers/aws.rb and 31 other locations - About 45 mins to fix
      modules/mu/providers/aws.rb on lines 1077..1081
      modules/mu/providers/aws.rb on lines 1091..1095
      modules/mu/providers/aws.rb on lines 1099..1103
      modules/mu/providers/aws.rb on lines 1107..1111
      modules/mu/providers/aws.rb on lines 1115..1119
      modules/mu/providers/aws.rb on lines 1129..1133
      modules/mu/providers/aws.rb on lines 1137..1141
      modules/mu/providers/aws.rb on lines 1145..1149
      modules/mu/providers/aws.rb on lines 1153..1157
      modules/mu/providers/aws.rb on lines 1161..1165
      modules/mu/providers/aws.rb on lines 1169..1173
      modules/mu/providers/aws.rb on lines 1178..1182
      modules/mu/providers/aws.rb on lines 1186..1190
      modules/mu/providers/aws.rb on lines 1194..1198
      modules/mu/providers/aws.rb on lines 1202..1206
      modules/mu/providers/aws.rb on lines 1210..1214
      modules/mu/providers/aws.rb on lines 1226..1230
      modules/mu/providers/aws.rb on lines 1234..1238
      modules/mu/providers/aws.rb on lines 1242..1246
      modules/mu/providers/aws.rb on lines 1250..1254
      modules/mu/providers/aws.rb on lines 1266..1270
      modules/mu/providers/aws.rb on lines 1274..1278
      modules/mu/providers/aws.rb on lines 1282..1286
      modules/mu/providers/aws.rb on lines 1290..1294
      modules/mu/providers/aws.rb on lines 1298..1302
      modules/mu/providers/aws.rb on lines 1306..1310
      modules/mu/providers/aws.rb on lines 1314..1318
      modules/mu/providers/aws.rb on lines 1322..1326
      modules/mu/providers/aws.rb on lines 1330..1334
      modules/mu/providers/aws.rb on lines 1338..1342
      modules/mu/providers/aws.rb on lines 1346..1350

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 40.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                  if !user['domain']
                    if my_domains.size == 1
                      user['domain'] = my_domains.first
                    elsif my_domains.size > 1
                      MU.log "Google interactive User #{user['name']} did not specify a domain, and we have multiple defaults available. Must specify exactly one.", MU::ERR, details: my_domains
      Severity: Minor
      Found in modules/mu/providers/google/user.rb and 1 other location - About 45 mins to fix
      modules/mu/providers/google/group.rb on lines 317..325

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 40.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Avoid deeply nested control flow statements.
      Open

                      if policy["step_adjustments"].nil? || policy["step_adjustments"].empty?
                        MU.log "You must specify 'step_adjustments' when 'policy_type' is set to 'StepScaling'", MU::ERR
                        ok = false
                      end
      Severity: Major
      Found in modules/mu/providers/aws/server_pool.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                        if sib_by_name.size == 1
                          @vpc = sib_by_name.values.first
                          MU.log "Single VPC match for #{self}", loglevel, details: @vpc.to_s
                        else
        # XXX ok but this is the wrong place for this really the config parser needs to sort this out somehow
        Severity: Major
        Found in modules/mu/cloud/resource_base.rb - About 45 mins to fix

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

                def self.validate(db, configurator)
                  ok = true
                  read_replicas = []
                  cluster_nodes = []
          
          
          Severity: Minor
          Found in modules/mu/config/database.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

          Avoid deeply nested control flow statements.
          Open

                            my_cidr = nil if my_cidr.to_s.match(/^10\.255\./)
          Severity: Major
          Found in modules/mu/config/vpc.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                          if wait >= 30
                            MU.log "User #{user} has been created in LDAP, but local system can't see it. Are PAM/LDAP configured correctly?", MU::ERR
                            return false
                          end
            Severity: Major
            Found in modules/mu/master/ldap.rb - About 45 mins to fix

              Similar blocks of code found in 32 locations. Consider refactoring.
              Open

                    def self.lambda(region: MU.curRegion, credentials: nil)
                      region ||= myRegion
                      @@lambda_api[credentials] ||= {}
                      @@lambda_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "Lambda", region: region, credentials: credentials)
                      @@lambda_api[credentials][region]
              Severity: Major
              Found in modules/mu/providers/aws.rb and 31 other locations - About 45 mins to fix
              modules/mu/providers/aws.rb on lines 1077..1081
              modules/mu/providers/aws.rb on lines 1091..1095
              modules/mu/providers/aws.rb on lines 1099..1103
              modules/mu/providers/aws.rb on lines 1107..1111
              modules/mu/providers/aws.rb on lines 1115..1119
              modules/mu/providers/aws.rb on lines 1129..1133
              modules/mu/providers/aws.rb on lines 1137..1141
              modules/mu/providers/aws.rb on lines 1145..1149
              modules/mu/providers/aws.rb on lines 1153..1157
              modules/mu/providers/aws.rb on lines 1161..1165
              modules/mu/providers/aws.rb on lines 1169..1173
              modules/mu/providers/aws.rb on lines 1178..1182
              modules/mu/providers/aws.rb on lines 1186..1190
              modules/mu/providers/aws.rb on lines 1194..1198
              modules/mu/providers/aws.rb on lines 1202..1206
              modules/mu/providers/aws.rb on lines 1210..1214
              modules/mu/providers/aws.rb on lines 1218..1222
              modules/mu/providers/aws.rb on lines 1226..1230
              modules/mu/providers/aws.rb on lines 1234..1238
              modules/mu/providers/aws.rb on lines 1250..1254
              modules/mu/providers/aws.rb on lines 1266..1270
              modules/mu/providers/aws.rb on lines 1274..1278
              modules/mu/providers/aws.rb on lines 1282..1286
              modules/mu/providers/aws.rb on lines 1290..1294
              modules/mu/providers/aws.rb on lines 1298..1302
              modules/mu/providers/aws.rb on lines 1306..1310
              modules/mu/providers/aws.rb on lines 1314..1318
              modules/mu/providers/aws.rb on lines 1322..1326
              modules/mu/providers/aws.rb on lines 1330..1334
              modules/mu/providers/aws.rb on lines 1338..1342
              modules/mu/providers/aws.rb on lines 1346..1350

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 40.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 32 locations. Consider refactoring.
              Open

                    def self.dynamo(region: MU.curRegion, credentials: nil)
                      region ||= myRegion
                      @@dynamo_api[credentials] ||= {}
                      @@dynamo_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "DynamoDB", region: region, credentials: credentials)
                      @@dynamo_api[credentials][region]
              Severity: Major
              Found in modules/mu/providers/aws.rb and 31 other locations - About 45 mins to fix
              modules/mu/providers/aws.rb on lines 1077..1081
              modules/mu/providers/aws.rb on lines 1091..1095
              modules/mu/providers/aws.rb on lines 1099..1103
              modules/mu/providers/aws.rb on lines 1107..1111
              modules/mu/providers/aws.rb on lines 1115..1119
              modules/mu/providers/aws.rb on lines 1129..1133
              modules/mu/providers/aws.rb on lines 1137..1141
              modules/mu/providers/aws.rb on lines 1145..1149
              modules/mu/providers/aws.rb on lines 1153..1157
              modules/mu/providers/aws.rb on lines 1161..1165
              modules/mu/providers/aws.rb on lines 1169..1173
              modules/mu/providers/aws.rb on lines 1178..1182
              modules/mu/providers/aws.rb on lines 1186..1190
              modules/mu/providers/aws.rb on lines 1194..1198
              modules/mu/providers/aws.rb on lines 1202..1206
              modules/mu/providers/aws.rb on lines 1210..1214
              modules/mu/providers/aws.rb on lines 1218..1222
              modules/mu/providers/aws.rb on lines 1226..1230
              modules/mu/providers/aws.rb on lines 1234..1238
              modules/mu/providers/aws.rb on lines 1242..1246
              modules/mu/providers/aws.rb on lines 1250..1254
              modules/mu/providers/aws.rb on lines 1266..1270
              modules/mu/providers/aws.rb on lines 1274..1278
              modules/mu/providers/aws.rb on lines 1290..1294
              modules/mu/providers/aws.rb on lines 1298..1302
              modules/mu/providers/aws.rb on lines 1306..1310
              modules/mu/providers/aws.rb on lines 1314..1318
              modules/mu/providers/aws.rb on lines 1322..1326
              modules/mu/providers/aws.rb on lines 1330..1334
              modules/mu/providers/aws.rb on lines 1338..1342
              modules/mu/providers/aws.rb on lines 1346..1350

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 40.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Avoid deeply nested control flow statements.
              Open

                              unless policy['type']
                                MU.log "You must specify a 'type' when 'policy_type' is set to 'StepScaling'", MU::ERR
                                ok = false
                              end
              Severity: Major
              Found in modules/mu/providers/aws/server_pool.rb - About 45 mins to fix

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

                    def initialize(path, skipinitialupdates = false, params: {}, updating: nil, default_credentials: nil, cloud: nil)
                      $myPublicIp ||= MU.mu_public_ip
                      $myRoot ||= MU.myRoot
                      $myRoot.freeze
                
                
                Severity: Minor
                Found in modules/mu/config.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

                Avoid deeply nested control flow statements.
                Open

                            path.pop if path.last == name
                Severity: Major
                Found in modules/mu/adoption.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if ![:removed].include?(tier[:action])
                                myreport["slack"] += ". New #{tier[:field] ? "`"+tier[:field]+"`" : :value}: \*#{tier[:value]}\*"
                              else
                                myreport["slack"] += " (was \*#{tier[:value]}\*)"
                              end
                  Severity: Major
                  Found in modules/mu/adoption.rb - About 45 mins to fix

                    Similar blocks of code found in 32 locations. Consider refactoring.
                    Open

                          def self.kms(region: MU.curRegion, credentials: nil)
                            region ||= myRegion
                            @@kms_api[credentials] ||= {}
                            @@kms_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "KMS", region: region, credentials: credentials)
                            @@kms_api[credentials][region]
                    Severity: Major
                    Found in modules/mu/providers/aws.rb and 31 other locations - About 45 mins to fix
                    modules/mu/providers/aws.rb on lines 1077..1081
                    modules/mu/providers/aws.rb on lines 1091..1095
                    modules/mu/providers/aws.rb on lines 1099..1103
                    modules/mu/providers/aws.rb on lines 1107..1111
                    modules/mu/providers/aws.rb on lines 1115..1119
                    modules/mu/providers/aws.rb on lines 1129..1133
                    modules/mu/providers/aws.rb on lines 1137..1141
                    modules/mu/providers/aws.rb on lines 1145..1149
                    modules/mu/providers/aws.rb on lines 1153..1157
                    modules/mu/providers/aws.rb on lines 1161..1165
                    modules/mu/providers/aws.rb on lines 1169..1173
                    modules/mu/providers/aws.rb on lines 1178..1182
                    modules/mu/providers/aws.rb on lines 1186..1190
                    modules/mu/providers/aws.rb on lines 1194..1198
                    modules/mu/providers/aws.rb on lines 1202..1206
                    modules/mu/providers/aws.rb on lines 1210..1214
                    modules/mu/providers/aws.rb on lines 1218..1222
                    modules/mu/providers/aws.rb on lines 1226..1230
                    modules/mu/providers/aws.rb on lines 1234..1238
                    modules/mu/providers/aws.rb on lines 1242..1246
                    modules/mu/providers/aws.rb on lines 1250..1254
                    modules/mu/providers/aws.rb on lines 1266..1270
                    modules/mu/providers/aws.rb on lines 1274..1278
                    modules/mu/providers/aws.rb on lines 1282..1286
                    modules/mu/providers/aws.rb on lines 1290..1294
                    modules/mu/providers/aws.rb on lines 1298..1302
                    modules/mu/providers/aws.rb on lines 1306..1310
                    modules/mu/providers/aws.rb on lines 1314..1318
                    modules/mu/providers/aws.rb on lines 1322..1326
                    modules/mu/providers/aws.rb on lines 1330..1334
                    modules/mu/providers/aws.rb on lines 1346..1350

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 40.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 3 locations. Consider refactoring.
                    Open

                            def initialize(mommacat: nil, kitten_cfg: nil, mu_name: nil, cloud_id: nil)
                              @deploy = mommacat
                              @config = kitten_cfg
                              @cloud_id ||= cloud_id
                              if !mu_name.nil?
                    Severity: Major
                    Found in modules/mu/providers/cloudformation/collection.rb and 2 other locations - About 45 mins to fix
                    modules/mu/providers/cloudformation/alarm.rb on lines 31..41
                    modules/mu/providers/cloudformation/log.rb on lines 31..41

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 40.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                              if @config['raw_policies']
                                pol_arns = MU::Cloud.resourceClass("AWS", "Role").manageRawPolicies(
                                  @config['raw_policies'],
                                  basename: @deploy.getResourceName(@config['name']),
                                  credentials: @credentials
                    Severity: Minor
                    Found in modules/mu/providers/aws/group.rb and 1 other location - About 45 mins to fix
                    modules/mu/providers/aws/user.rb on lines 111..118

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 40.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language