Katello/katello

View on GitHub

Showing 2,689 of 2,689 total issues

File repositories_controller.rb has 654 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Katello
  class Api::V2::RepositoriesController < Api::V2::ApiController # rubocop:disable Metrics/ClassLength
    include Katello::Concerns::FilteredAutoCompleteSearch

    generic_repo_wrap_params = []
Severity: Major
Found in app/controllers/katello/api/v2/repositories_controller.rb - About 1 day to fix

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

      const actionButtons = showActions ? (
        <Split hasGutter>
          <SplitItem>
            <ActionList isIconList>
              <ActionListItem>
    webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.js on lines 378..416

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

    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

      const actionButtons = showActions ? (
        <Split hasGutter>
          <SplitItem>
            <ActionList isIconList>
              <ActionListItem>
    webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js on lines 419..457

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

    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 ModuleStreamsTab.js has 644 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { useCallback, useState } from 'react';
    import { useSelector } from 'react-redux';
    import { FormattedMessage } from 'react-intl';
    import { translate as __ } from 'foremanReact/common/I18n';
    import { Skeleton,

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

      angular.module('Bastion.docker-tags').controller('DockerTagEnvironmentsController',
          ['$scope', '$location', 'Nutupane', 'DockerTag', 'CurrentOrganization', 'translate',
          function ($scope, $location, Nutupane, DockerTag, CurrentOrganization, translate) {
              var params = {
                  'organization_id': CurrentOrganization,
      engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/docker-tag-repositories.controller.js on lines 14..47

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

      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

      angular.module('Bastion.docker-tags').controller('DockerTagRepositoriesController',
          ['$scope', '$location', 'Nutupane', 'DockerTag', 'CurrentOrganization', 'translate',
          function ($scope, $location, Nutupane, DockerTag, CurrentOrganization, translate) {
              var params = {
                  'organization_id': CurrentOrganization,
      engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/docker-tag-environments.controller.js on lines 14..46

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

      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 registry_proxies_controller.rb has 636 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module Katello
        # rubocop:disable Metrics/ClassLength
        class Api::Registry::RegistryProxiesController < Api::V2::ApiController
          before_action :disable_strong_params
          before_action :confirm_settings
      Severity: Major
      Found in app/controllers/katello/api/registry/registry_proxies_controller.rb - About 1 day to fix

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

        test('Upgrade is disabled when there are non-upgradable packages selected', async (done) => {
          const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
        
          const scope = nockInstance
            .get(hostPackages)
        webpack/components/extensions/HostDetails/Tabs/__tests__/debsTab.test.js on lines 344..372

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

        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

        test('Upgrade is disabled when there are non-upgradable packages selected', async (done) => {
          const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
        
          const scope = nockInstance
            .get(hostDebs)
        webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 345..373

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

        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 RepositorySetsTab.js has 633 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, {
          useCallback,
          useEffect,
          useState,
          useMemo,

          Function container has 279 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          KT.container = (function(){
              var pre_selection = {};
              var setup = function() {
                  var orgDropdown = $('#organization_id'),
                      envDropdown = $('#kt_environment_id'),
          Severity: Major
          Found in app/assets/javascripts/katello/containers/container.js - About 1 day to fix

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

              results: [
                {
                  id: 3,
                  cp_id: 'ff8080815ea5ea44015ea617b1a5000b',
                  subscription_id: 3,
            webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js on lines 40..93
            webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js on lines 213..266

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

            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

              results: [
                {
                  id: 3,
                  cp_id: 'ff8080815ea5ea44015ea617b1a5000b',
                  subscription_id: 2,
            webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js on lines 40..93
            webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js on lines 144..197

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

            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

              results: [
                {
                  id: 3,
                  cp_id: 'ff8080815ea5ea44015ea617b1a5000b',
                  subscription_id: 2,
            webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js on lines 144..197
            webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js on lines 213..266

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

            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

            Function ContentViewTable has 272 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const ContentViewTable = () => {
              const response = useSelector(selectContentViews);
              const status = useSelector(selectContentViewStatus);
              const error = useSelector(selectContentViewError);
              const [searchQuery, updateSearchQuery] = useState('');
            Severity: Major
            Found in webpack/scenes/ContentViews/Table/ContentViewsTable.js - About 1 day to fix

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

              import React from 'react';
              import { act, renderWithRedux, patientlyWaitFor, fireEvent } from 'react-testing-lib-wrapper';
              import { Route } from 'react-router-dom';
              import { head, last } from 'lodash';
              import { nockInstance, assertNockRequest, mockAutocomplete } from '../../../../../../test-utils/nockWrapper';

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

                test('Remove is disabled when in select all mode', async (done) => {
                  const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
                  const scope = nockInstance
                    .get(hostPackages)
                    .query(defaultQuery)
                webpack/components/extensions/HostDetails/Tabs/__tests__/debsTab.test.js on lines 374..398

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

                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

                test('Remove is disabled when in select all mode', async (done) => {
                  const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
                  const scope = nockInstance
                    .get(hostDebs)
                    .query(defaultQuery)
                webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 375..399

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

                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

                Function path_select has 267 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                KT.path_select = function(div_id, name, environments, options_in){
                
                    var div,
                        scroll_obj,
                        paths_id,
                Severity: Major
                Found in app/assets/javascripts/katello/widgets/path_selector.js - About 1 day to fix

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

                    const permissionDeniedPage = shallow(<SubscriptionsPage
                      setModalOpen={noop}
                      setModalClosed={noop}
                      organization={organization}
                      subscriptions={permissionDeniedState}
                  webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js on lines 31..64

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

                  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