SUSE/machinery

View on GitHub

Showing 187 of 267 total issues

Method integration_tests_sheet has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def integration_tests_sheet(matrix)
    @document.text "Integration Tests", align: :center, size: 24
    @document.move_down 22

    matrix.integration_tests.each do |test, support|
Severity: Minor
Found in tools/support_matrix/lib/support_matrix/pdf_formatter.rb - About 1 hr to fix

    Method upgrade has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

      def upgrade(store, name, options = {})
        if !options[:all] && !store.list.include?(name)
          raise Machinery::Errors::SystemDescriptionNotFound.new(
            "System description '#{name}' does not exist."
          )
    Severity: Minor
    Found in lib/upgrade_format_task.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 compare_with has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def compare_with(other)
          if extracted != other.extracted
            Machinery::Ui.warn("Warning: Comparing extracted with unextracted" \
              " unmanaged files. Only common attributes are considered.")
          end
    Severity: Minor
    Found in plugins/unmanaged_files/unmanaged_files_model.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 content has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

          def content(description)
            return unless description["changed_managed_files"]
    
            if description["changed_managed_files"]
              files, errors = description["changed_managed_files"].partition do |file|
    Severity: Minor
    Found in plugins/changed_managed_files/changed_managed_files_renderer.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 analyze has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

      def analyze(description)
        description.assert_scopes("os")
        check_os(description)
        Machinery::LocalSystem.validate_existence_of_packages(["zypper"])
        description.validate_analysis_compatibility
    Severity: Minor
    Found in lib/analyze_changed_config_files_diffs_task.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

    Function initialSetup has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function initialSetup() {
      $(".parallax-img-container").each(function() {
        var widthOfContainer = $(this).width();
        var heightOfContainer = $(this).height();
        var setOfElements = $(this).children();
    Severity: Minor
    Found in manual/docs/js/parallaxImg.js - About 1 hr to fix

      Method analyze has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def analyze(description)
          description.assert_scopes("os")
          check_os(description)
          Machinery::LocalSystem.validate_existence_of_packages(["zypper"])
          description.validate_analysis_compatibility
      Severity: Minor
      Found in lib/analyze_changed_config_files_diffs_task.rb - About 1 hr to fix

        Method deploy has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def deploy(description, cloud_config, options = {})
            Machinery::LocalSystem.validate_architecture("x86_64")
            Machinery::LocalSystem.validate_existence_of_packages(
              ["python-glanceclient", "kiwi", "kiwi-desc-vmxboot"]
            )
        Severity: Minor
        Found in lib/deploy_task.rb - About 1 hr to fix

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

            def deploy(description, cloud_config, options = {})
              Machinery::LocalSystem.validate_architecture("x86_64")
              Machinery::LocalSystem.validate_existence_of_packages(
                ["python-glanceclient", "kiwi", "kiwi-desc-vmxboot"]
              )
          Severity: Minor
          Found in lib/deploy_task.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 mode_string_to_octal has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            def mode_string_to_octal(mode)
              result = 0
          
              # The following code is intentionally stupid.
          
          
          Severity: Minor
          Found in lib/tarball.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 migrate_description has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              def migrate_description(store, description_name, options = {})
                load_migrations
          
                hash = Machinery::Manifest.load(
                  description_name,
          Severity: Minor
          Found in lib/migration.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 managed_file_states has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              def managed_file_states(output_location)
                salt_root_dir = "root"
                output_root_path = File.join(output_location, salt_root_dir)
                FileUtils.mkdir_p(output_root_path)
          
          
          Severity: Minor
          Found in lib/salt_states.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 convert_element has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              def convert_element(element)
                (self.class.element_classes || []).each do |definition|
                  condition = definition[:if]
                  klass = definition[:class]
                  if condition
          Severity: Minor
          Found in lib/array.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 apply_services has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def apply_services
              if @system_description["services"]
                init_system = @system_description["services"].init_system
          
                case init_system
          Severity: Minor
          Found in lib/kiwi_config.rb - About 1 hr to fix

            Method compare_with has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def compare_with(other)
                  if extracted != other.extracted
                    Machinery::Ui.warn("Warning: Comparing extracted with unextracted" \
                      " unmanaged files. Only common attributes are considered.")
                  end
            Severity: Minor
            Found in plugins/unmanaged_files/unmanaged_files_model.rb - About 1 hr to fix

              Method inspect_dpkg has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def inspect_dpkg
                    dpkg_data = @system.run_command(
                      "dpkg", "-l", stdout: :capture
                    )
              
              
              Severity: Minor
              Found in plugins/packages/packages_inspector.rb - About 1 hr to fix

                Method inject_extracted_files has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def inject_extracted_files(output_location)
                    ["changed_managed_files", "changed_config_files"].each do |scope|
                      next unless @system_description.scope_extracted?(scope)
                
                      output_root_path = File.join(output_location, "root")
                Severity: Minor
                Found in lib/kiwi_config.rb - About 1 hr to fix

                  Method parse_scopes has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def self.parse_scopes(scope_string)
                        unknown_scopes = []
                        invalid_scopes = []
                        scopes = []
                  
                  
                  Severity: Minor
                  Found in lib/cli.rb - About 1 hr to fix

                    Method generate_changelog has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def generate_changelog
                        changes = { @release_version => create_rpm_header(@release_version, @release_time, @mail) }
                        news = { @release_version => "" }
                        CHANGELOG_FILES.each do |file|
                          version = @release_version
                    Severity: Minor
                    Found in tools/release.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 run_with_progress has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def run_with_progress(*command, type, &callback)
                        output = ""
                        error = ""
                        write_io = StringIO.new(output, "a")
                        error_io = StringIO.new(error, "a")
                    Severity: Minor
                    Found in lib/system.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

                    Severity
                    Category
                    Status
                    Source
                    Language