caskdata/hadoop_cookbook

View on GitHub

Showing 11 of 831 total issues

File repo.rb has 301 lines of code (exceeds 250 allowed). Consider refactoring.
Open

major_platform_version = node['platform_version'].to_i
key = 'RPM-GPG-KEY'

# Ensure apt caches are updated and apt resources available
include_recipe 'apt' if node['platform_family'] == 'debian'
Severity: Minor
Found in recipes/repo.rb - About 3 hrs to fix

    Method hdp_version has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def hdp_version
          case node['hadoop']['distribution_version']
          when '2.2.0.0'
            '2.2.0.0-2041'
          when '2.2.1.0'
    Severity: Major
    Found in libraries/helpers.rb - About 2 hrs to fix

      Method check_jaas_config has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_jaas_config(service)
            %w(client master).each do |type|
              next unless node[service].key?("#{type}_jaas")
              %w(client server).each do |key| # These are JAAS keys, not files
                next unless node[service]["#{type}_jaas"].key?(key) &&
      Severity: Minor
      Found in libraries/helpers.rb - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      File default.rb has 252 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      include_recipe 'hadoop::repo'
      include_recipe 'hadoop::_hadoop_checkconfig'
      include_recipe 'hadoop::_compression_libs'
      
      package hadoop_package('hadoop-client') do
      Severity: Minor
      Found in recipes/default.rb - About 2 hrs to fix

        Method check_deprecated_jaas_config has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def check_deprecated_jaas_config(service)
              if node[service].key?('jaas')
                %w(client server).each do |key|
                  next unless node[service]['jaas'].key?(key) &&
                              node[service]['jaas'][key].key?('usekeytab') &&
        Severity: Minor
        Found in libraries/helpers.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

        Method hadoop_package has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def hadoop_package(name)
              return name unless hdp22? || iop?
              return name if node['platform_family'] == 'debian'
              fw =
                if name == 'spark-core'
        Severity: Minor
        Found in libraries/helpers.rb - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Consider simplifying this complex logical expression.
        Open

          notifies :run, 'execute[systemd-daemon-reload]', :immediately if
            (node['platform_family'] == 'rhel' && node['platform_version'].to_i >= 7) ||
            (node['platform'] == 'ubuntu' && node['platform_version'].to_i >= 16) ||
            (node['platform'] == 'debian' && node['platform_version'].to_i >= 8)
        Severity: Major
        Found in test/fixtures/cookbooks/hadoop_test/recipes/yarn.rb - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

            notifies :run, 'execute[systemd-daemon-reload]', :immediately if
              (node['platform_family'] == 'rhel' && node['platform_version'].to_i >= 7) ||
              (node['platform'] == 'ubuntu' && node['platform_version'].to_i >= 16) ||
              (node['platform'] == 'debian' && node['platform_version'].to_i >= 8)
          Severity: Major
          Found in test/fixtures/cookbooks/hadoop_test/recipes/hdfs.rb - About 40 mins to fix

            Method hadoop_config has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def hadoop_config(service, key, property, deprecated_property = nil, default_value = nil)
            Severity: Minor
            Found in libraries/helpers.rb - About 35 mins to fix

              Method hdp_build_number has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def hdp_build_number(version)
                    repo_path = [
                      'http://public-repo-1.hortonworks.com/HDP',
                      hdp_repo_os_path,
                      '2.x/updates',
              Severity: Minor
              Found in libraries/helpers.rb - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method write_jaas_config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def write_jaas_config(service)
                    # Setup client_jaas.conf master_jaas.conf
                    %w(client master).each do |type|
                      next unless node[service].key?("#{type}_jaas") &&
                                  node[service]["#{type}_jaas"].key?('client')
              Severity: Minor
              Found in libraries/helpers.rb - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Severity
              Category
              Status
              Source
              Language