Katello/katello

View on GitHub

Showing 2,689 of 2,689 total issues

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

      <DataListItem key="headers" >
        <DataListItemRow>
          <DataListItemCells dataListCells={[
            <DataListCell key="primary content">
              <b>{__('Repository')}</b>
Severity: Major
Found in webpack/scenes/SmartProxy/ExpandedSmartProxyRepositories.js and 1 other location - About 7 hrs to fix
webpack/scenes/SmartProxy/ExpandedSmartProxyRepositories.js on lines 54..66

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

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

require "pulpcore_client"
module Katello
  module Pulp3
    class Repository
      include Katello::Util::HttpProxy
Severity: Minor
Found in app/services/katello/pulp3/repository.rb - About 7 hrs to fix

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

          {affectedActivationKeys &&
            <>
              <h3>{__('Activation keys')}</h3>
              <Flex>
                <FlexItem><ExclamationTriangleIcon /></FlexItem>
    webpack/scenes/ContentViews/Delete/Steps/CVDeletionReview.js on lines 42..50
    webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js on lines 53..61
    webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js on lines 62..70

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

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

          {affectedHosts &&
            <>
              <h3>{__('Content hosts')}</h3>
              <Flex>
                <FlexItem><ExclamationTriangleIcon /></FlexItem>
    webpack/scenes/ContentViews/Delete/Steps/CVDeletionReview.js on lines 51..59
    webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js on lines 53..61
    webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js on lines 62..70

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

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

          {affectedActivationKeys &&
            <>
              <h3>{__('Activation keys')}</h3>
              <Flex>
                <FlexItem><ExclamationTriangleIcon /></FlexItem>
    webpack/scenes/ContentViews/Delete/Steps/CVDeletionReview.js on lines 42..50
    webpack/scenes/ContentViews/Delete/Steps/CVDeletionReview.js on lines 51..59
    webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js on lines 53..61

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

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

          {affectedHosts &&
            <>
              <h3>{__('Content hosts')}</h3>
              <Flex>
                <FlexItem><ExclamationTriangleIcon /></FlexItem>
    webpack/scenes/ContentViews/Delete/Steps/CVDeletionReview.js on lines 42..50
    webpack/scenes/ContentViews/Delete/Steps/CVDeletionReview.js on lines 51..59
    webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js on lines 62..70

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

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

    import React from 'react';
    import { renderWithRedux, patientlyWaitFor, fireEvent } from 'react-testing-lib-wrapper';
    import { Route } from 'react-router-dom';
    
    import ContentViewFilterDetails from '../ContentViewFilterDetails';

      File subscriptions.fixtures.js has 465 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import Immutable from 'seamless-immutable';
      import { toastErrorAction, failureAction } from '../../../services/api/testHelpers';
      
      export const initialState = Immutable({
        loading: true,
      Severity: Minor
      Found in webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js - About 7 hrs to fix

        Function RepositoryRoutes has 174 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function RepositoryRoutes($stateProvider) {
                /**
                 * @ngdoc object
                 * @name  Bastion.repositories:RepositoryRoutes
                 *

          File CVErrataIDFilterContent.js has 455 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 { capitalize, omit, isEqual } from 'lodash';

            Function TableWrapper has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

            const TableWrapper = ({
              actionButtons,
              alwaysShowActionButtons,
              alwaysShowToggleGroup,
              toggleGroup,
            Severity: Minor
            Found in webpack/components/Table/TableWrapper.js - About 6 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

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

            test('Can handle no packages being present', async (done) => {
              // Setup autocomplete with mockForemanAutoComplete since we aren't adding /katello
              const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
            
              const noResults = {
            webpack/components/extensions/HostDetails/Tabs/__tests__/debsTab.test.js on lines 81..105

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

            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={__('SSL client certificate')}
                        type="string"
                        fieldId="ssl_client_cert"
                      >
            webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditCredentials.js on lines 270..298

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

            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={__('SSL client key')}
                        type="string"
                        fieldId="client_key"
                      >
            webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditCredentials.js on lines 241..269

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

            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('Can handle no packages being present', async (done) => {
              // Setup autocomplete with mockForemanAutoComplete since we aren't adding /katello
              const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
            
              const noResults = {
            webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 85..109

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

            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

                            } else if (syncStatus['last_failed_reclaim_tasks'].length > 0) {
                                activeOrFailedTask = pickLastTask(syncStatus['last_failed_reclaim_tasks']);
                                $scope.syncTask = activeOrFailedTask;
                                errorCount = $scope.syncTask.humanized.errors.length;
            
            
            engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js on lines 100..128

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

            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

                            } else if (syncStatus['last_failed_sync_tasks'].length > 0) {
                                activeOrFailedTask = pickLastTask(syncStatus['last_failed_sync_tasks']);
                                $scope.syncTask = activeOrFailedTask;
                                errorCount = $scope.syncTask.humanized.errors.length;
            
            
            engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js on lines 114..128

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

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

            require 'proxy_api'
            require 'proxy_api/pulp'
            require 'proxy_api/pulp_node'
            require 'proxy_api/container_gateway'
            
            
            Severity: Minor
            Found in app/models/katello/concerns/smart_proxy_extensions.rb - About 6 hrs to fix

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

              export const getTaskSuccessResponse = Immutable({
                id: 'eb1b6271-8a69-4d98-84fc-bea06ddcc166',
                label: 'Actions::Katello::Organization::ManifestRefresh',
                pending: false,
                username: 'admin',
              Severity: Major
              Found in webpack/scenes/Tasks/__tests__/task.fixtures.js and 1 other location - About 6 hrs to fix
              webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js on lines 87..130

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

              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

              export const taskSuccessResponse = Immutable({
                id: 'c6e7dd0b-1d40-4c75-b1e0-b193c4d0597f',
                label: 'Actions::Katello::Organization::ManifestRefresh',
                pending: false,
                username: 'admin',
              webpack/scenes/Tasks/__tests__/task.fixtures.js on lines 3..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 171.

              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