Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

                success = function (response) {
                    Notification.setSuccessMessage(translate('Removed %x products from sync plan "%y".')
                        .replace('%x', $scope.table.numSelected).replace('%y', $scope.syncPlan.name));
                    $scope.table.working = false;
                    $scope.table.selectAll(false);
engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-add-products.controller.js on lines 52..60

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

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

Method construct_repo_from_params has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    def construct_repo_from_params(repo_params) # rubocop:disable Metrics/AbcSize
      root = @product.add_repo(repo_params.slice(:label, :name, :description, :url, :content_type, :arch, :unprotected,
                                                            :gpg_key, :ssl_ca_cert, :ssl_client_cert, :ssl_client_key,
                                                            :checksum_type, :download_policy, :http_proxy_policy,
                                                            :metadata_expire).to_h.with_indifferent_access)
Severity: Minor
Found in app/controllers/katello/api/v2/repositories_controller.rb - 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

Function EnvironmentContentController has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function EnvironmentContentController($scope, ContentService, ContentView, Repository, translate, $location) {
        var nutupane, allRepositories, nutupaneParams;

        $scope.controllerName = 'katello_environments';

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

    AffectedRepositoryTable.propTypes = {
      cvId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
      filterId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
      repoType: PropTypes.string.isRequired,
      setShowAffectedRepos: PropTypes.func.isRequired,
    webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 473..481
    webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 306..314
    webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 296..304

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

    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

    CVModuleStreamFilterContent.propTypes = {
      cvId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
      filterId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
      showAffectedRepos: PropTypes.bool.isRequired,
      setShowAffectedRepos: PropTypes.func.isRequired,
    webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js on lines 266..274
    webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 473..481
    webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 296..304

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

    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

    CVErrataIDFilterContent.propTypes = {
      cvId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
      filterId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
      showAffectedRepos: PropTypes.bool.isRequired,
      setShowAffectedRepos: PropTypes.func.isRequired,
    webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js on lines 266..274
    webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 306..314
    webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 296..304

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

    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

    CVPackageGroupFilterContent.propTypes = {
      cvId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
      filterId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
      showAffectedRepos: PropTypes.bool.isRequired,
      setShowAffectedRepos: PropTypes.func.isRequired,
    webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js on lines 266..274
    webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 473..481
    webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 306..314

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

    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

    Class ContentFacet has 35 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class ContentFacet < Katello::Model
          audited :associated_with => :host
          self.table_name = 'katello_content_facets'
          include Facets::Base
    
    
    Severity: Minor
    Found in app/models/katello/host/content_facet.rb - About 4 hrs to fix

      Class Product has 35 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Product < Katello::Model
          audited
      
          include ForemanTasks::Concerns::ActionSubject
          include Glue::Candlepin::Product
      Severity: Minor
      Found in app/models/katello/product.rb - About 4 hrs to fix

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

                <FormGroup label={__('Role')} fieldId="role">
                  <FormSelect
                    id="role"
                    name="role"
                    ouiaId="role-select"
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 229..245
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 246..262
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 263..279

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

        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

                <FormGroup label={__('SLA')} fieldId="serviceLevel">
                  <FormSelect
                    id="serviceLevel"
                    name="serviceLevel"
                    ouiaId="service-level-select"
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 212..228
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 246..262
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 263..279

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

        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

                <FormGroup label={__('Usage')} fieldId="usage">
                  <FormSelect
                    id="usage"
                    name="usage"
                    ouiaId="usage-select"
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 212..228
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 229..245
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 263..279

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

        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

                <FormGroup label={__('Release version')} fieldId="releaseVersion">
                  <FormSelect
                    id="releaseVersion"
                    name="release_version"
                    ouiaId="release-version-select"
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 212..228
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 229..245
        webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 246..262

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

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

        export const BulkPackagesReviewFooter = () => {
          const {
            finishButtonText,
            finishButtonLoading,
            setFinishButtonLoading,

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

                            <SplitItem>
                              <Dropdown
                                toggle={<KebabToggle aria-label="bulk_actions" onToggle={toggleBulkAction} />}
                                isOpen={bulkActionOpen}
                                ouiaId="cv-errata-id-bulk-action-dropdown"
          webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js on lines 180..192
          webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 273..285
          webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 263..275
          webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js on lines 160..172

          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

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

                            <SplitItem>
                              <Dropdown
                                toggle={<KebabToggle aria-label="bulk_actions" onToggle={toggleBulkAction} />}
                                isOpen={bulkActionOpen}
                                ouiaId="bulk-actions-dropdown"
          webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js on lines 180..192
          webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 339..351
          webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 263..275
          webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js on lines 160..172

          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

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

                        <SplitItem>
                          <Dropdown
                            toggle={<KebabToggle aria-label="bulk_actions" onToggle={toggleBulkAction} />}
                            isOpen={bulkActionOpen}
                            ouiaId="cv-filters-bulk-action"
          webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js on lines 180..192
          webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 339..351
          webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 273..285
          webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 263..275

          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

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

                            <SplitItem>
                              <Dropdown
                                toggle={<KebabToggle aria-label="bulk_actions" onToggle={toggleBulkAction} />}
                                isOpen={bulkActionOpen}
                                ouiaId="cv-package-group-filter-bulk-actions-dropdown"
          webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js on lines 180..192
          webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 339..351
          webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 273..285
          webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js on lines 160..172

          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

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

                              <SplitItem>
                                <Dropdown
                                  toggle={<KebabToggle aria-label="bulk_actions" onToggle={toggleBulkAction} />}
                                  isOpen={bulkActionOpen}
                                  ouiaId="cv-container-image-bulk-actions"
          webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js on lines 339..351
          webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 273..285
          webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 263..275
          webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js on lines 160..172

          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

          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.host.subscription_facet_attributes.purpose_role;
                          if (role && !_.includes(roles, role)) {
          engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js on lines 184..193

          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

          Severity
          Category
          Status
          Source
          Language