Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

Class RepositoryType has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

  class RepositoryType
    class << self
      def def_field(*names)
        class_eval do
          names.each do |name|
Severity: Minor
Found in app/services/katello/repository_type.rb - About 2 hrs to fix

    Function buildCells has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const buildCells = (cvVersion) => {
        const {
          version,
          description,
          id: versionId,
    Severity: Major
    Found in webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js - About 2 hrs to fix

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

                        <SelectOption
                          isDisabled={singleSelection('enhancement') || !hasPermission(permissions, 'edit_content_views')}
                          key="enhancement"
                          value="enhancement"
                        >
      webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 147..155
      webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 165..173

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

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

        const dropdownItems = dropdownOptions.map(text => (
          <DropdownItem key={`option_${text}`} ouiaId={`option_${text}`} onClick={() => setSelectedOption(text)}>{text}</DropdownItem>
        ));
      webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_Review.js on lines 37..39
      webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_Review.js on lines 37..39

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

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

        const dropdownItems = dropdownOptions.map(text => (
          <DropdownItem key={`option_${text}`} ouiaId={`option_${text}`} onClick={() => setSelectedRexOption(text)}>{text}</DropdownItem>
        ));
      webpack/components/extensions/HostDetails/Tabs/TracesTab/EnableTracerModal.js on lines 103..105
      webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_Review.js on lines 37..39

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

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

                        <SelectOption
                          isDisabled={singleSelection('security') || !hasPermission(permissions, 'edit_content_views')}
                          key="security"
                          value="security"
                        >
      webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 156..164
      webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 165..173

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

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

                        <SelectOption
                          isDisabled={singleSelection('bugfix') || !hasPermission(permissions, 'edit_content_views')}
                          key="bugfix"
                          value="bugfix"
                        >
      webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 147..155
      webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 156..164

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

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

        const dropdownItems = dropdownOptions.map(text => (
          <DropdownItem key={`option_${text}`} ouiaId={`option_${text}`} onClick={() => setSelectedRexOption(text)}>{text}</DropdownItem>
        ));
      webpack/components/extensions/HostDetails/Tabs/TracesTab/EnableTracerModal.js on lines 103..105
      webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_Review.js on lines 37..39

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

      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

              <FormGroup
                label={__('Description')}
                type="string"
                fieldId="acs_description"
              >
      webpack/scenes/AlternateContentSources/Create/Steps/NameACS.js on lines 41..52

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

      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

              <FormGroup label={__('RPM name')} isRequired fieldId="name">
                <SearchText
                  data={{
                    autocomplete: {
                      url: nameAutoCompleteEndpoint,
      webpack/scenes/ContentViews/Details/Filters/Rules/ContainerTag/AddEditContainerTagRuleModal.js on lines 66..76

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

      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

              <FormGroup
                label={__('Description')}
                type="string"
                fieldId="acs_description"
              >
      webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js on lines 58..71

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

      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

              <FormGroup label={__('Tag name')} isRequired fieldId="tag_name">
                <SearchText
                  data={{
                    autocomplete: {
                      url: autoCompleteEndpoint,
      webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js on lines 158..168

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

      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

      File RemoteExecutionActions.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { API_OPERATIONS, get, post } from 'foremanReact/redux/API';
      import { stopInterval, withInterval } from 'foremanReact/redux/middlewares/IntervalMiddleware';
      import { REX_JOB_INVOCATIONS_KEY, REX_FEATURES } from './RemoteExecutionConstants';
      import { foremanApi } from '../../../../services/api';
      import { errorToast, renderRexJobStartedToast } from '../../../../scenes/Tasks/helpers';

        File CVRpmFilterContent.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { useState, useEffect, useCallback } from 'react';
        import useDeepCompareEffect from 'use-deep-compare-effect';
        import PropTypes from 'prop-types';
        import { shallowEqual, useSelector, useDispatch } from 'react-redux';
        import { TableVariant } from '@patternfly/react-table';
        Severity: Minor
        Found in webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js - About 2 hrs to fix

          File content_view_versions_controller.rb has 256 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module Katello
            class Api::V2::ContentViewVersionsController < Api::V2::ApiController
              include ::Api::V2::BulkHostsExtension
              include Katello::Concerns::FilteredAutoCompleteSearch
          
          
          Severity: Minor
          Found in app/controllers/katello/api/v2/content_view_versions_controller.rb - About 2 hrs to fix

            Function HostActionsBar has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const HostActionsBar = () => {
              const hostDetails = useSelector(selectHostDetails);
              const dispatch = useDispatch();
              const hostname = hostDetails?.name;
              const { onKebabToggle } = useContext(ForemanActionsBarContext);
            Severity: Major
            Found in webpack/components/extensions/HostDetails/ActionsBar/index.js - About 2 hrs to fix

              File moduleStreamsTab.test.js has 255 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React from 'react';
              import { act } from 'react-test-renderer';
              import { renderWithRedux, patientlyWaitFor, within, fireEvent } from 'react-testing-lib-wrapper';
              import { nockInstance, assertNockRequest, mockForemanAutocomplete } from '../../../../../test-utils/nockWrapper';
              import { ModuleStreamsTab } from '../ModuleStreamsTab/ModuleStreamsTab.js';

                File task_status.rb has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module Katello
                  class TaskStatus < Katello::Model
                    include Util::TaskStatus
                
                    serialize :result
                Severity: Minor
                Found in app/models/katello/task_status.rb - About 2 hrs to fix

                  Method plan has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def plan(content_view, options)
                            cv_envs = options.fetch(:content_view_environments, [])
                            versions = options.fetch(:content_view_versions, [])
                            organization_destroy = options.fetch(:organization_destroy, false)
                            skip_repo_destroy = options.fetch(:skip_repo_destroy, false)
                  Severity: Major
                  Found in app/lib/actions/katello/content_view/remove.rb - About 2 hrs to fix

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

                      const envPathFlat = useMemo(() => {
                        if (!environmentPathLoading) {
                          const { results } = environmentPathResponse || {};
                          return results.map(result => result.environments).flatten();
                        }
                    webpack/scenes/ContentViews/Details/Promote/ContentViewVersionPromote.js on lines 75..81

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

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

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

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

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

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language