cloudamatic/mu

View on GitHub

Showing 2,704 of 2,705 total issues

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/alarm.rb and 2 other locations - About 45 mins to fix
modules/mu/providers/cloudformation/collection.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

Avoid deeply nested control flow statements.
Open

                  if step["adjustment"].nil?
                    MU.log "You must specify 'adjustment' for '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 step["adjustment"] >= 1 && policy["estimated_instance_warmup"].nil?
                        MU.log "You must specify 'estimated_instance_warmup' when 'policy_type' is set to 'StepScaling' and adding capacity", 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 public
                            { "Fn::GetAtt" => [@dependencies["server"][dnsrec['target']].cloudobj.cfm_name, "PublicDnsName"] }
                          else
                            { "Fn::GetAtt" => [@dependencies["server"][dnsrec['target']].cloudobj.cfm_name, "PrivateDnsName"] }
                          end
      Severity: Major
      Found in modules/mu/providers/cloudformation/dnszone.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    for c in (0..(path.size-1)) do
                      path_str << ("  " * (c+2)) + (path[c] || "<nil>")
                    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.cloudwatch(region: MU.curRegion, credentials: nil)
                  region ||= myRegion
                  @@cloudwatch_api[credentials] ||= {}
                  @@cloudwatch_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "CloudWatch", region: region, credentials: credentials)
                  @@cloudwatch_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 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 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.eks(region: MU.curRegion, credentials: nil)
                  region ||= myRegion
                  @@eks_api[credentials] ||= {}
                  @@eks_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "EKS", region: region, credentials: credentials)
                  @@eks_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 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

          Avoid deeply nested control flow statements.
          Open

                        if mu_acct
                          attr[:userAccountControl] = (attr[:userAccountControl].to_i & AD_PW_ATTRS['pwdNeverExpires']).to_s
                        end
          Severity: Major
          Found in modules/mu/master/ldap.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                          MU.log "#{@deploy_id}'s original config has #{@original_config[type].size == 1 ? "a" : @original_config[type].size.to_s} #{type}, but loadObjects could not populate anything from deployment metadata", MU::ERR if !@object_load_fails
            Severity: Major
            Found in modules/mu/mommacat/search.rb - About 45 mins to fix

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

                    def self.wafglobal(region: MU.curRegion, credentials: nil)
                      region ||= myRegion
                      @@wafglobal_api[credentials] ||= {}
                      @@wafglobal[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "WAF", region: region, credentials: credentials)
                      @@wafglobal[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 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 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.dynamostream(region: MU.curRegion, credentials: nil)
                      region ||= myRegion
                      @@dynamostream_api[credentials] ||= {}
                      @@dynamostream_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "DynamoDBStreams", region: region, credentials: credentials)
                      @@dynamostream_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 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

              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/log.rb and 2 other locations - About 45 mins to fix
              modules/mu/providers/cloudformation/alarm.rb on lines 31..41
              modules/mu/providers/cloudformation/collection.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

              Avoid deeply nested control flow statements.
              Open

                                raise MuError, "Couldn't find #{dnsrec['mu_type']} #{dnsrec["target"]}" if found.nil? || found.empty?
              Severity: Major
              Found in modules/mu/providers/cloudformation/dnszone.rb - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    configurator.nat_routes[subnet['name'].to_s] = [] if configurator.nat_routes[subnet['name'].to_s].nil?
                Severity: Major
                Found in modules/mu/config/vpc.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                    server.cloud_desc.public_dns_name.empty? ? server.cloud_desc.private_dns_name : server.cloud_desc.public_dns_name
                  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.elb(region: MU.curRegion, credentials: nil)
                            region ||= myRegion
                            @@elb_api[credentials] ||= {}
                            @@elb_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "ElasticLoadBalancing", region: region, credentials: credentials)
                            @@elb_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 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 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.cloudwatchevents(region: MU.curRegion, credentials: nil)
                            region ||= myRegion
                            @@cloudwatchevents_api[credentials] ||= {}
                            @@cloudwatchevents_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "CloudWatchEvents", region: region, credentials: credentials)
                            @@cloudwatchevents_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 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.acm(region: MU.curRegion, credentials: nil)
                            region ||= myRegion
                            @@acm_api[credentials] ||= {}
                            @@acm_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "ACM", region: region, credentials: credentials)
                            @@acm_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 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 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.apig(region: MU.curRegion, credentials: nil)
                            region ||= myRegion
                            @@apig_api[credentials] ||= {}
                            @@apig_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "APIGateway", region: region, credentials: credentials)
                            @@apig_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 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

                    Avoid deeply nested control flow statements.
                    Open

                                      if step["lower_bound"].nil? && step["upper_bound"].nil?
                                        MU.log "You must specify 'lower_bound' and/or upper_bound for '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
                      Severity
                      Category
                      Status
                      Source
                      Language