Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

        $scope.purposeUsages = function () {
            return $scope.organization.$promise.then(function(org) {
                var usages = org.system_purposes.usage;
                var usage = $scope.host.subscription_facet_attributes.purpose_usage;
                if (usage && !_.includes(usages, usage)) {
engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js on lines 173..182

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

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

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Grid, Col, Row, Tabs, Tab, FormControl, ControlLabel } from 'react-bootstrap';
import { FormattedMessage } from 'react-intl';
import { Button, Spinner } from 'patternfly-react';
Severity: Minor
Found in webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js - About 4 hrs to fix

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

    export const promoteContentViewVersion = (params, handleSuccess) => post({
      type: API_OPERATIONS.POST,
      key: cvVersionPromoteKey(params.id, params.versionEnvironments),
      url: api.getApiUrl(`/content_view_versions/${params.id}/promote`),
      params,
    webpack/scenes/ContentViews/Details/ContentViewDetailActions.js on lines 613..623

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

    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 republishCVVRepoMetadata = (params, handleSuccess) => put({
      type: API_OPERATIONS.PUT,
      key: cvVersionRepublishRepoMetadataKey(params.cvId, params.id),
      url: api.getApiUrl(`/content_view_versions/${params.id}/republish_repositories`),
      params,
    webpack/scenes/ContentViews/Details/ContentViewDetailActions.js on lines 601..611

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

    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

        function DebRepositoriesController($scope, Nutupane, Repository, CurrentOrganization, translate) {
            var repositoriesNutupane,
                params = {
                    'deb_id': $scope.$stateParams.debId,
                    'organization_id': CurrentOrganization
    engines/bastion_katello/app/assets/javascripts/bastion_katello/files/details/file-repositories.controller.js on lines 13..30

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

    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

        function FileRepositoriesController($scope, Nutupane, Repository, CurrentOrganization, translate) {
            var repositoriesNutupane,
                params = {
                    'file_id': $scope.$stateParams.fileId,
                    'organization_id': CurrentOrganization
    engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/deb-repositories.controller.js on lines 13..30

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

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

    import React, { useCallback, useRef } from 'react';
    import useDeepCompareEffect from 'use-deep-compare-effect';
    import PropTypes from 'prop-types';
    import { useDispatch } from 'react-redux';
    import { isEqual, isEmpty } from 'lodash';
    Severity: Minor
    Found in webpack/components/Table/TableWrapper.js - About 4 hrs to fix

      Function CVDeletionReassignActivationKeysForm has 109 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const CVDeletionReassignActivationKeysForm = () => {
        const dispatch = useDispatch();
        const contentViewsInEnvResponse = useSelector(state => selectContentViews(state, 'keys'));
        const contentViewsInEnvStatus = useSelector(state => selectContentViewStatus(state, 'keys'));
        const contentViewsInEnvError = useSelector(state => selectContentViewError(state, 'keys'));

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

              {(repositories.length || showAffectedRepos) &&
                <Tab
                  ouiaId="affected-repos-tab"
                  eventKey={1}
                  title={<TabTitleText>{__('Affected repositories')}</TabTitleText>}
        webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js on lines 206..216
        webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js on lines 231..240
        webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 317..326
        webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 291..301
        webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 281..291
        webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js on lines 245..254

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

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

              {(repositories.length || showAffectedRepos) &&
                <Tab
                  ouiaId="affected-repositories-tab"
                  eventKey={1}
                  title={<TabTitleText>{__('Affected repositories')}</TabTitleText>}
        webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js on lines 206..216
        webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js on lines 231..240
        webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 458..468
        webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 291..301
        webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 281..291
        webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js on lines 245..254

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

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

              {(repositories.length || showAffectedRepos) &&
                <Tab
                  ouiaId="affected-repos-tab"
                  eventKey={1}
                  title={<TabTitleText>{__('Affected repositories')}</TabTitleText>}
        webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js on lines 206..216
        webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js on lines 231..240
        webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 317..326
        webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 458..468
        webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 281..291
        webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js on lines 245..254

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

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

              {(repositories.length || showAffectedRepos) &&
                <Tab
                  ouiaId="cv-rpm-filter-content-affected-repos-tab"
                  eventKey={1}
                  title={<TabTitleText>{__('Affected repositories')}</TabTitleText>}
        webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js on lines 206..216
        webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js on lines 231..240
        webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 317..326
        webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 458..468
        webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 291..301
        webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 281..291

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

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

              {(repositories.length || showAffectedRepos) &&
                <Tab
                  ouiaId="affected-repos-tab"
                  eventKey={1}
                  title={<TabTitleText>{__('Affected repositories')}</TabTitleText>}
        webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js on lines 206..216
        webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js on lines 231..240
        webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 317..326
        webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 458..468
        webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 291..301
        webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js on lines 245..254

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

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

              {(repositories.length || showAffectedRepos) &&
                <Tab
                  ouiaId="cv-deb-filter-content-affected-repos-tab"
                  eventKey={1}
                  title={<TabTitleText>{__('Affected Repositories')}</TabTitleText>}
        webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js on lines 206..216
        webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 317..326
        webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 458..468
        webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 291..301
        webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 281..291
        webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js on lines 245..254

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

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

              {(repositories.length || showAffectedRepos) &&
                <Tab
                  ouiaId="cv-container-image-affected-repos-tab"
                  eventKey={1}
                  title={<TabTitleText>{__('Affected repositories')}</TabTitleText>}
        webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js on lines 231..240
        webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js on lines 317..326
        webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 458..468
        webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 291..301
        webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 281..291
        webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js on lines 245..254

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

        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 CVDeletionReassignHostsForm has 107 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const CVDeletionReassignHostsForm = () => {
          const dispatch = useDispatch();
          const contentViewsInEnvResponse = useSelector(state => selectContentViews(state, 'host'));
          const contentViewsInEnvStatus = useSelector(state => selectContentViewStatus(state, 'host'));
          const contentViewsInEnvError = useSelector(state => selectContentViewError(state, 'host'));

          Function ErrataTab has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

          export const ErrataTab = () => {
            const hostDetails = useSelector(state => selectAPIResponse(state, 'HOST_DETAILS'));
            const {
              id: hostId,
              name: hostname,
          Severity: Minor
          Found in webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js - About 4 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

                  $scope.purposeUsages = function () {
                      return $scope.organization.$promise.then(function(org) {
                          var usages = org.system_purposes.usage;
                          var usage = $scope.activationKey.purpose_usage;
                          if (usage && !_.includes(usages, usage)) {
          engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js on lines 106..115

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

          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

                  $scope.purposeRoles = function () {
                      return $scope.organization.$promise.then(function(org) {
                          var roles = org.system_purposes.roles;
                          var role = $scope.activationKey.purpose_role;
                          if (role && !_.includes(roles, role)) {
          engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js on lines 95..104

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

          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

                {contentViewsInEnvStatus === STATUS.RESOLVED &&
                  !!selectedLifecycleEnv.length && contentViewsInEnv.length === 0 &&
                  <Alert
                    ouiaId="no-cv-alert"
                    variant="warning"
          webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js on lines 162..174

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

          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