cloudamatic/mu

View on GitHub
modules/mu/providers/aws.rb

Summary

Maintainability
F
1 wk
Test Coverage

Class has too many lines. [1203/1000]
Open

    class AWS
      @@myRegion_var = nil

      @@creds_loaded = {}

Severity: Minor
Found in modules/mu/providers/aws.rb by rubocop

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

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

    class AWS
      @@myRegion_var = nil

      @@creds_loaded = {}

Severity: Major
Found in modules/mu/providers/aws.rb - About 1 day to fix

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

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

      Assignment Branch Condition size for method_missing is too high. [146.1/75]
      Open

              def method_missing(method_sym, *arguments)
                # make sure error symbols are loaded for our exception handling later
                require "aws-sdk-lambda"
                require "aws-sdk-rds"
                require "aws-sdk-ec2"
      Severity: Minor
      Found in modules/mu/providers/aws.rb by rubocop

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

      Assignment Branch Condition size for openFirewallForClients is too high. [129.8/75]
      Open

            def self.openFirewallForClients
              require "aws-sdk-ec2"
              MU::Cloud.resourceClass("AWS", :FirewallRule)
              begin
                if File.exist?(Etc.getpwuid(Process.uid).dir+"/.chef/knife.rb")
      Severity: Minor
      Found in modules/mu/providers/aws.rb by rubocop

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

      Assignment Branch Condition size for loadCredentials is too high. [99.76/75]
      Open

            def self.loadCredentials(name = nil)
              gem 'aws-sdk-core'
              @@creds_loaded ||= {}
      
              if name.nil?
      Severity: Minor
      Found in modules/mu/providers/aws.rb by rubocop

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

      Cyclomatic complexity for method_missing is too high. [40/30]
      Open

              def method_missing(method_sym, *arguments)
                # make sure error symbols are loaded for our exception handling later
                require "aws-sdk-lambda"
                require "aws-sdk-rds"
                require "aws-sdk-ec2"
      Severity: Minor
      Found in modules/mu/providers/aws.rb by rubocop

      This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

      An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

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

              def method_missing(method_sym, *arguments)
                # make sure error symbols are loaded for our exception handling later
                require "aws-sdk-lambda"
                require "aws-sdk-rds"
                require "aws-sdk-ec2"
      Severity: Minor
      Found in modules/mu/providers/aws.rb by rubocop

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

      Example:

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

      Perceived complexity for loadCredentials is too high. [40/35]
      Open

            def self.loadCredentials(name = nil)
              gem 'aws-sdk-core'
              @@creds_loaded ||= {}
      
              if name.nil?
      Severity: Minor
      Found in modules/mu/providers/aws.rb by rubocop

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

      Example:

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

      Cyclomatic complexity for loadCredentials is too high. [34/30]
      Open

            def self.loadCredentials(name = nil)
              gem 'aws-sdk-core'
              @@creds_loaded ||= {}
      
              if name.nil?
      Severity: Minor
      Found in modules/mu/providers/aws.rb by rubocop

      This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

      An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

      Assignment Branch Condition size for findSSLCertificate is too high. [76.12/75]
      Open

            def self.findSSLCertificate(name: nil, id: nil, region: myRegion, credentials: nil, raise_on_missing: true)
              require "aws-sdk-iam"
              if (name.nil? or name.empty?) and (id.nil? or id.empty?)
                raise MuError, "Can't call findSSLCertificate without specifying either a name or an id"
              end
      Severity: Minor
      Found in modules/mu/providers/aws.rb by rubocop

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

      Cyclomatic complexity for credConfig is too high. [31/30]
      Open

            def self.credConfig(name = nil, name_only: false)
              # If there's nothing in mu.yaml (which is wrong), but we're running
              # on a machine hosted in AWS, *and* that machine has an IAM profile,
              # fake it with those credentials and hope for the best.
              if !$MU_CFG['aws'] or !$MU_CFG['aws'].is_a?(Hash) or $MU_CFG['aws'].size == 0
      Severity: Minor
      Found in modules/mu/providers/aws.rb by rubocop

      This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

      An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

      Method credConfig has a Cognitive Complexity of 84 (exceeds 75 allowed). Consider refactoring.
      Open

            def self.credConfig(name = nil, name_only: false)
              # If there's nothing in mu.yaml (which is wrong), but we're running
              # on a machine hosted in AWS, *and* that machine has an IAM profile,
              # fake it with those credentials and hope for the best.
              if !$MU_CFG['aws'] or !$MU_CFG['aws'].is_a?(Hash) or $MU_CFG['aws'].size == 0
      Severity: Minor
      Found in modules/mu/providers/aws.rb - About 1 hr 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

                            new_args << {} if new_args.empty?
      Severity: Major
      Found in modules/mu/providers/aws.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            elsif new_args.is_a?(Hash)
                              new_args[page_markers[paginator]] = new_page
        Severity: Major
        Found in modules/mu/providers/aws.rb - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                        if name.nil?
          #                Aws.config = {
          #                  access_key_id: data['access_key'],
          #                  secret_access_key: data['access_secret'],
          #                  region: cred_cfg['region']
          Severity: Major
          Found in modules/mu/providers/aws.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                  if new_args.size == 1 and new_args.first.is_a?(Hash)
                                    new_args[0][page_markers[paginator]] = new_page
                                  else
                                    MU.log "I don't know how to insert a #{paginator} into these arguments for #{method_sym}", MU::WARN, details: new_args
                                  end
            Severity: Major
            Found in modules/mu/providers/aws.rb - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            if acct_num.to_s == name.to_s
                              @@acct_to_profile_map[name.to_s] = cfg
                              return name_only ? name.to_s : cfg
                            end
              Severity: Major
              Found in modules/mu/providers/aws.rb - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                              if cfg['account_number'] and name.to_s == cfg['account_number'].to_s
                                return name_only ? acctname : $MU_CFG['aws'][acctname]
                              end
                Severity: Major
                Found in modules/mu/providers/aws.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                    return name_only ? "#default" : @@my_hosted_cfg
                  Severity: Major
                  Found in modules/mu/providers/aws.rb - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                  rescue StandardError => e
                                    MU.log e.inspect, MU::WARN, details: cfg
                                    next
                    Severity: Major
                    Found in modules/mu/providers/aws.rb - About 45 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return name_only ? name : $MU_CFG['aws'][name]
                      Severity: Major
                      Found in modules/mu/providers/aws.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return name_only ? name.to_s : cfg
                        Severity: Major
                        Found in modules/mu/providers/aws.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return name_only ? name : @@acct_to_profile_map[name.to_s]
                          Severity: Major
                          Found in modules/mu/providers/aws.rb - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                          return name_only ? set : cfg
                            Severity: Major
                            Found in modules/mu/providers/aws.rb - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return name_only ? acctname : $MU_CFG['aws'][acctname]
                              Severity: Major
                              Found in modules/mu/providers/aws.rb - About 30 mins to fix

                                Avoid more than 4 levels of block nesting.
                                Open

                                                  return name_only ? "#default" : @@my_hosted_cfg
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for excessive nesting of conditional and looping constructs.

                                You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

                                The maximum level of nesting allowed is configurable.

                                Avoid more than 4 levels of block nesting.
                                Open

                                                    if new_args.is_a?(Array)
                                                      new_args << {} if new_args.empty?
                                                      if new_args.size == 1 and new_args.first.is_a?(Hash)
                                                        new_args[0][page_markers[paginator]] = new_page
                                                      else
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for excessive nesting of conditional and looping constructs.

                                You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

                                The maximum level of nesting allowed is configurable.

                                Avoid more than 4 levels of block nesting.
                                Open

                                                    break if resp.nil?
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for excessive nesting of conditional and looping constructs.

                                You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

                                The maximum level of nesting allowed is configurable.

                                Avoid more than 4 levels of block nesting.
                                Open

                                                    resp = resp.__getobj__ if resp.respond_to?(:__getobj__)
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for excessive nesting of conditional and looping constructs.

                                You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

                                The maximum level of nesting allowed is configurable.

                                Avoid more than 4 levels of block nesting.
                                Open

                                                    new_page = resp.send(paginator) if !resp.nil?
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for excessive nesting of conditional and looping constructs.

                                You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

                                The maximum level of nesting allowed is configurable.

                                Use =~ in places where the MatchData returned by #match will not be used.
                                Open

                                              if desc.match(/^0000: (?:[0-9a-f]{2} ){16}"(.+?)\./)
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop identifies the use of Regexp#match or String#match, which returns #<MatchData>/nil. The return value of =~ is an integral index/nil and is more performant.

                                Example:

                                # bad
                                do_something if str.match(/regex/)
                                while regex.match('str')
                                  do_something
                                end
                                
                                # good
                                method(str =~ /regex/)
                                return value unless regex =~ 'str'

                                Use each_value instead of values.each.
                                Open

                                        MU::MommaCat.listAllNodes.values.each { |data|
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for uses of each_key and each_value Hash methods.

                                Note: If you have an array of two-element arrays, you can put parentheses around the block arguments to indicate that you're not working with a hash, and suppress RuboCop offenses.

                                Example:

                                # bad
                                hash.keys.each { |k| p k }
                                hash.values.each { |v| p v }
                                hash.each { |k, _v| p k }
                                hash.each { |_k, v| p v }
                                
                                # good
                                hash.each_key { |k| p k }
                                hash.each_value { |v| p v }

                                Use =~ in places where the MatchData returned by #match will not be used.
                                Open

                                        if id.match(/^arn:aws(?:-us-gov)?:acm/)
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop identifies the use of Regexp#match or String#match, which returns #<MatchData>/nil. The return value of =~ is an integral index/nil and is more performant.

                                Example:

                                # bad
                                do_something if str.match(/regex/)
                                while regex.match('str')
                                  do_something
                                end
                                
                                # good
                                method(str =~ /regex/)
                                return value unless regex =~ 'str'

                                Use =~ in places where the MatchData returned by #match will not be used.
                                Open

                                        elsif id.match(/^arn:aws(?:-us-gov)?:iam/)
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop identifies the use of Regexp#match or String#match, which returns #<MatchData>/nil. The return value of =~ is an integral index/nil and is more performant.

                                Example:

                                # bad
                                do_something if str.match(/regex/)
                                while regex.match('str')
                                  do_something
                                end
                                
                                # good
                                method(str =~ /regex/)
                                return value unless regex =~ 'str'

                                Use each_value instead of each.
                                Open

                                          MU::MommaCat.listOptionalTags.each { |key, value|
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for uses of each_key and each_value Hash methods.

                                Note: If you have an array of two-element arrays, you can put parentheses around the block arguments to indicate that you're not working with a hash, and suppress RuboCop offenses.

                                Example:

                                # bad
                                hash.keys.each { |k| p k }
                                hash.values.each { |v| p v }
                                hash.each { |k, _v| p k }
                                hash.each { |_k, v| p v }
                                
                                # good
                                hash.each_key { |k| p k }
                                hash.each_value { |v| p v }

                                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

                                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

                                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 32 locations. Consider refactoring.
                                Open

                                      def self.cloudtrail(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@cloudtrail_api[credentials] ||= {}
                                        @@cloudtrail_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "CloudTrail", region: region, credentials: credentials)
                                        @@cloudtrail_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 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.s3(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@s3_api[credentials] ||= {}
                                        @@s3_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "S3", region: region, credentials: credentials)
                                        @@s3_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 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.elb2(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@elb2_api[credentials] ||= {}
                                        @@elb2_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "ElasticLoadBalancingV2", region: region, credentials: credentials)
                                        @@elb2_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 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.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.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

                                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.efs(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@efs_api[credentials] ||= {}
                                        @@efs_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "EFS", region: region, credentials: credentials)
                                        @@efs_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 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.pricing(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@pricing_api[credentials] ||= {}
                                        @@pricing_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "Pricing", region: region, credentials: credentials)
                                        @@pricing_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 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.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.cloudwatchlogs(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@cloudwatchlogs_api[credentials] ||= {}
                                        @@cloudwatchlogs_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "CloudWatchLogs", region: region, credentials: credentials)
                                        @@cloudwatchlogs_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 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.cloudfront(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@cloudfront_api[credentials] ||= {}
                                        @@cloudfront_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "CloudFront", region: region, credentials: credentials)
                                        @@cloudfront_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 1338..1342

                                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.rds(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@rds_api[credentials] ||= {}
                                        @@rds_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "RDS", region: region, credentials: credentials)
                                        @@rds_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 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.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.sqs(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@sqs_api[credentials] ||= {}
                                        @@sqs_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "SQS", region: region, credentials: credentials)
                                        @@sqs_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 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.autoscale(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@autoscale_api[credentials] ||= {}
                                        @@autoscale_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "AutoScaling", region: region, credentials: credentials)
                                        @@autoscale_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 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.cloudformation(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@cloudformation_api[credentials] ||= {}
                                        @@cloudformation_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "CloudFormation", region: region, credentials: credentials)
                                        @@cloudformation_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 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.ssm(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@ssm_api[credentials] ||= {}
                                        @@ssm_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "SSM", region: region, credentials: credentials)
                                        @@ssm_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 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.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

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

                                      def self.ec2(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@ec2_api[credentials] ||= {}
                                        @@ec2_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "EC2", region: region, credentials: credentials)
                                        @@ec2_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 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.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

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

                                      def self.elasticsearch(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@elasticsearch_api[credentials] ||= {}
                                        @@elasticsearch_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "ElasticsearchService", region: region, credentials: credentials)
                                        @@elasticsearch_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 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.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.cloudfront(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@cloudfront_api[credentials] ||= {}
                                        @@cloudfront_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "CloudFront", region: region, credentials: credentials)
                                        @@cloudfront_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 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.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.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.ecs(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@ecs_api[credentials] ||= {}
                                        @@ecs_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "ECS", region: region, credentials: credentials)
                                        @@ecs_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 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.cognito_ident(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@cognito_ident_api[credentials] ||= {}
                                        @@cognito_ident_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "CognitoIdentity", region: region, credentials: credentials)
                                        @@cognito_ident_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 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.cognito_user(region: MU.curRegion, credentials: nil)
                                        region ||= myRegion
                                        @@cognito_user_api[credentials] ||= {}
                                        @@cognito_user_api[credentials][region] ||= MU::Cloud::AWS::AmazonEndpoint.new(api: "CognitoIdentityProvider", region: region, credentials: credentials)
                                        @@cognito_user_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 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 2 locations. Consider refactoring.
                                Open

                                            if retries < 10 and retries > 2
                                              debuglevel = MU::NOTICE
                                              interval = 20 + Random.rand(10) - 3
                                            # elsif retries >= 10 and retries <= 100
                                            elsif retries >= 10
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb and 1 other location - About 35 mins to fix
                                modules/mu/providers/google.rb on lines 1551..1560

                                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 36.

                                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

                                      def self.config_example
                                        sample = hosted_config
                                        sample ||= {
                                          "region" => "us-east-1",
                                          "account_number" => "123456789012",
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb and 1 other location - About 25 mins to fix
                                modules/mu/providers/google.rb on lines 118..126

                                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 29.

                                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

                                Useless assignment to variable - ok.
                                Open

                                        ok = true
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

                                assigned but unused variable - foo

                                Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

                                Example:

                                # bad
                                
                                def some_method
                                  some_var = 1
                                  do_something
                                end

                                Example:

                                # good
                                
                                def some_method
                                  some_var = 1
                                  do_something(some_var)
                                end

                                Do not suppress exceptions.
                                Open

                                          rescue Aws::IAM::Errors::ValidationError, Aws::IAM::Errors::NoSuchEntity
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for rescue blocks with no body.

                                Example:

                                # bad
                                
                                def some_method
                                  do_something
                                rescue
                                  # do nothing
                                end

                                Example:

                                # bad
                                
                                begin
                                  do_something
                                rescue
                                  # do nothing
                                end

                                Example:

                                # good
                                
                                def some_method
                                  do_something
                                rescue
                                  handle_exception
                                end

                                Example:

                                # good
                                
                                begin
                                  do_something
                                rescue
                                  handle_exception
                                end

                                Redundant use of Object#to_s in interpolation.
                                Open

                                            MU.log "Got #{e.inspect} calling EC2's #{method_sym} in #{@region} with credentials #{@credentials}, waiting #{interval.to_s}s and retrying. Args were: #{arguments}", debuglevel, details: caller
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for string conversion in string interpolation, which is redundant.

                                Example:

                                # bad
                                
                                "result is #{something.to_s}"

                                Example:

                                # good
                                
                                "result is #{something}"

                                Redundant use of Object#to_s in interpolation.
                                Open

                                MU.log "cred_obj is nil and hosted? says #{hosted?.to_s}", MU::WARN, details: name
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for string conversion in string interpolation, which is redundant.

                                Example:

                                # bad
                                
                                "result is #{something.to_s}"

                                Example:

                                # good
                                
                                "result is #{something}"

                                Redundant use of Object#to_s in interpolation.
                                Open

                                                  MU.log "Revoking old rules for port #{port.to_s} from #{sg_id}", MU::NOTICE
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for string conversion in string interpolation, which is redundant.

                                Example:

                                # bad
                                
                                "result is #{something.to_s}"

                                Example:

                                # good
                                
                                "result is #{something}"

                                Unused method argument - use_cache.
                                Open

                                      def self.listHabitats(credentials = nil, use_cache: true)
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for unused method arguments.

                                Example:

                                # bad
                                
                                def some_method(used, unused, _unused_but_allowed)
                                  puts used
                                end

                                Example:

                                # good
                                
                                def some_method(used, _unused, _unused_but_allowed)
                                  puts used
                                end

                                end at 1675, 14 is not aligned with if at 1669, 23.
                                Open

                                              end
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks whether the end keywords are aligned properly.

                                Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

                                If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

                                If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

                                If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

                                Example: EnforcedStyleAlignWith: keyword (default)

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                variable = if true
                                           end

                                Example: EnforcedStyleAlignWith: variable

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                variable = if true
                                end

                                Example: EnforcedStyleAlignWith: startofline

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                puts(if true
                                end)

                                Unused block argument - key. If it's necessary, use _ or _key as an argument name to indicate that it won't be used.
                                Open

                                          MU::MommaCat.listOptionalTags.each { |key, value|
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for unused block arguments.

                                Example:

                                # bad
                                
                                do_something do |used, unused|
                                  puts used
                                end
                                
                                do_something do |bar|
                                  puts :foo
                                end
                                
                                define_method(:foo) do |bar|
                                  puts :baz
                                end

                                Example:

                                #good
                                
                                do_something do |used, _unused|
                                  puts used
                                end
                                
                                do_something do
                                  puts :foo
                                end
                                
                                define_method(:foo) do |_bar|
                                  puts :baz
                                end

                                Method MU::Cloud::AWS.cloudfront is defined at both modules/mu/providers/aws.rb:1202 and modules/mu/providers/aws.rb:1346.
                                Open

                                      def self.cloudfront(region: MU.curRegion, credentials: nil)
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for duplicated instance (or singleton) method definitions.

                                Example:

                                # bad
                                
                                def duplicated
                                  1
                                end
                                
                                def duplicated
                                  2
                                end

                                Example:

                                # bad
                                
                                def duplicated
                                  1
                                end
                                
                                alias duplicated other_duplicated

                                Example:

                                # good
                                
                                def duplicated
                                  1
                                end
                                
                                def other_duplicated
                                  2
                                end

                                Redundant use of Object#to_s in interpolation.
                                Open

                                                    MU.log "Permission disappeared from #{sg_id} (port #{port.to_s}) before I could remove it", MU::WARN, details: MU.structToHash(rule.ip_ranges)
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for string conversion in string interpolation, which is redundant.

                                Example:

                                # bad
                                
                                "result is #{something.to_s}"

                                Example:

                                # good
                                
                                "result is #{something}"

                                end at 515, 10 is not aligned with if at 509, 18.
                                Open

                                          end
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks whether the end keywords are aligned properly.

                                Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

                                If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

                                If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

                                If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

                                Example: EnforcedStyleAlignWith: keyword (default)

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                variable = if true
                                           end

                                Example: EnforcedStyleAlignWith: variable

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                variable = if true
                                end

                                Example: EnforcedStyleAlignWith: startofline

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                puts(if true
                                end)

                                Do not suppress exceptions.
                                Open

                                        rescue OpenURI::HTTPError, Timeout::Error, SocketError, Errno::EHOSTUNREACH
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for rescue blocks with no body.

                                Example:

                                # bad
                                
                                def some_method
                                  do_something
                                rescue
                                  # do nothing
                                end

                                Example:

                                # bad
                                
                                begin
                                  do_something
                                rescue
                                  # do nothing
                                end

                                Example:

                                # good
                                
                                def some_method
                                  do_something
                                rescue
                                  handle_exception
                                end

                                Example:

                                # good
                                
                                begin
                                  do_something
                                rescue
                                  handle_exception
                                end

                                Do not suppress exceptions.
                                Open

                                        rescue LoadError
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for rescue blocks with no body.

                                Example:

                                # bad
                                
                                def some_method
                                  do_something
                                rescue
                                  # do nothing
                                end

                                Example:

                                # bad
                                
                                begin
                                  do_something
                                rescue
                                  # do nothing
                                end

                                Example:

                                # good
                                
                                def some_method
                                  do_something
                                rescue
                                  handle_exception
                                end

                                Example:

                                # good
                                
                                begin
                                  do_something
                                rescue
                                  handle_exception
                                end

                                Do not suppress exceptions.
                                Open

                                            rescue JSON::ParserError => e
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for rescue blocks with no body.

                                Example:

                                # bad
                                
                                def some_method
                                  do_something
                                rescue
                                  # do nothing
                                end

                                Example:

                                # bad
                                
                                begin
                                  do_something
                                rescue
                                  # do nothing
                                end

                                Example:

                                # good
                                
                                def some_method
                                  do_something
                                rescue
                                  handle_exception
                                end

                                Example:

                                # good
                                
                                begin
                                  do_something
                                rescue
                                  handle_exception
                                end

                                end at 832, 8 is not aligned with if at 828, 18.
                                Open

                                        end
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks whether the end keywords are aligned properly.

                                Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

                                If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

                                If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

                                If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

                                Example: EnforcedStyleAlignWith: keyword (default)

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                variable = if true
                                           end

                                Example: EnforcedStyleAlignWith: variable

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                variable = if true
                                end

                                Example: EnforcedStyleAlignWith: startofline

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                puts(if true
                                end)

                                Redundant use of Object#to_s in interpolation.
                                Open

                                          raise MuError, "Got '#{e.message}' trying to validate region #{r} with credentials #{credentials ? credentials : "<default>"} (hosted: #{hosted?.to_s})"
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for string conversion in string interpolation, which is redundant.

                                Example:

                                # bad
                                
                                "result is #{something.to_s}"

                                Example:

                                # good
                                
                                "result is #{something}"

                                end at 135, 12 is not aligned with if at 131, 19.
                                Open

                                            end
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks whether the end keywords are aligned properly.

                                Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

                                If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

                                If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

                                If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

                                Example: EnforcedStyleAlignWith: keyword (default)

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                variable = if true
                                           end

                                Example: EnforcedStyleAlignWith: variable

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                variable = if true
                                end

                                Example: EnforcedStyleAlignWith: startofline

                                # bad
                                
                                variable = if true
                                    end
                                
                                # good
                                
                                puts(if true
                                end)

                                Do not suppress exceptions.
                                Open

                                            rescue NoMethodError
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for rescue blocks with no body.

                                Example:

                                # bad
                                
                                def some_method
                                  do_something
                                rescue
                                  # do nothing
                                end

                                Example:

                                # bad
                                
                                begin
                                  do_something
                                rescue
                                  # do nothing
                                end

                                Example:

                                # good
                                
                                def some_method
                                  do_something
                                rescue
                                  handle_exception
                                end

                                Example:

                                # good
                                
                                begin
                                  do_something
                                rescue
                                  handle_exception
                                end

                                Redundant use of Object#to_s in interpolation.
                                Open

                                          MU.log "Got '#{e.message}' trying to validate region #{r} (hosted: #{hosted?.to_s})", MU::ERR, details: loadCredentials(credentials)
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for string conversion in string interpolation, which is redundant.

                                Example:

                                # bad
                                
                                "result is #{something.to_s}"

                                Example:

                                # good
                                
                                "result is #{something}"

                                Redundant use of Object#to_s in interpolation.
                                Open

                                              MU.log "Failed to fetch AWS instance profile credentials, attempt #{retries.to_s}/10", MU::WARN
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for string conversion in string interpolation, which is redundant.

                                Example:

                                # bad
                                
                                "result is #{something.to_s}"

                                Example:

                                # good
                                
                                "result is #{something}"

                                Redundant use of Object#to_s in interpolation.
                                Open

                                            MU.log "Adding current IP list to allow rule for port #{port.to_s} in #{sg_id}", details: allow_ips
                                Severity: Minor
                                Found in modules/mu/providers/aws.rb by rubocop

                                This cop checks for string conversion in string interpolation, which is redundant.

                                Example:

                                # bad
                                
                                "result is #{something.to_s}"

                                Example:

                                # good
                                
                                "result is #{something}"

                                There are no issues that match your filters.

                                Category
                                Status