Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

                      <DropdownItem
                        aria-label="bulk_refresh"
                        ouiaId="bulk_refresh"
                        key="bulk_refresh"
                        isDisabled={selectedCount < 1 || !canEdit}
Severity: Major
Found in webpack/scenes/AlternateContentSources/MainTable/ACSTable.js and 1 other location - About 2 hrs to fix
webpack/scenes/AlternateContentSources/MainTable/ACSTable.js on lines 365..377

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

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

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

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

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

Refactorings

Further Reading

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

  const modalActions = ([
    <InstallDropdown
      key="install"
      isDisabled={!selectedCount}
      installViaRex={installViaRex}
webpack/components/extensions/HostDetails/Tabs/DebsTab/DebInstallModal.js on lines 144..154

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

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

                      <DropdownItem
                        aria-label="bulk_delete"
                        ouiaId="bulk_delete"
                        key="bulk_delete"
                        isDisabled={selectedCount < 1 || !canDelete}
Severity: Major
Found in webpack/scenes/AlternateContentSources/MainTable/ACSTable.js and 1 other location - About 2 hrs to fix
webpack/scenes/AlternateContentSources/MainTable/ACSTable.js on lines 352..364

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

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.table.getSelected = function () {
            var selectedRows = [];
            angular.forEach($scope.table.rows, function (row, rowIndex) {
                if (row.selected === true) {
                    selectedRows.push($scope.table.rows[rowIndex]);
engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js on lines 309..317

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

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

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

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

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

Refactorings

Further Reading

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

  const onSubmit = () => {
    setSaving(true);
    dispatch(editACS(
      acsId,
      { acsId, smart_proxy_names: acsSmartProxies, use_http_proxies: acsUseHttpProxies },
webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js on lines 15..28

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

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

module Katello
  module Host
    class SubscriptionFacet < Katello::Model
      audited :associated_with => :host, :associations => [:pools], :except => [:last_checkin]
      self.table_name = 'katello_subscription_facets'
Severity: Minor
Found in app/models/katello/host/subscription_facet.rb - About 2 hrs to fix

    Function DebsConfig has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function DebsConfig($stateProvider) {
            $stateProvider.state('debs', {
                url: '/debs',
                permission: ['view_products', 'view_content_views'],
                views: {

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

              <FormGroup
                label={__('Username')}
                isRequired
              >
                <TextInput
      webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CustomCdnTypeForm.js on lines 86..98
      webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/NetworkSyncForm.js on lines 150..162

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

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

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

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

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

      Refactorings

      Further Reading

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

              <FormGroup
                label={__('URL')}
                isRequired
              >
                <TextInput
      webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CustomCdnTypeForm.js on lines 86..98
      webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/NetworkSyncForm.js on lines 163..175

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

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

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

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

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

      Refactorings

      Further Reading

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

            <FormGroup
              label={__('URL')}
              isRequired
            >
              <TextInput
      webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/NetworkSyncForm.js on lines 150..162
      webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/NetworkSyncForm.js on lines 163..175

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

      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

        useDeepCompareEffect(() => {
          if (results && status === STATUS.RESOLVED) {
            setAvailableOptions(results?.map(product =>
              product.name).filter(p => !acsProducts.includes(p)));
          }
      webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditSmartProxies.js on lines 43..48

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

      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

              <Radio
                ouiaId="content-credentials-radio"
                label={__('Content credentials')}
                id="content_credentials"
                aria-label="content_credentials"
      webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditCredentials.js on lines 171..183

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

      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

              <Radio
                ouiaId="manual-auth-radio"
                label={__('Manual authentication')}
                id="manual_auth"
                name="manual_auth"
      webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditCredentials.js on lines 226..238

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

      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

        useDeepCompareEffect(() => {
          if (results && status === STATUS.RESOLVED) {
            setAvailableOptions(results?.map(proxy =>
              proxy.name).filter(p => !acsSmartProxies.includes(p)));
          }
      webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditProducts.js on lines 32..37

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

      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

          $stateProvider.state("host-collection", {
              abstract: true,
              url: '/host_collections/:hostCollectionId',
              permission: 'view_host_collections',
              controller: 'HostCollectionDetailsController',
      engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.routes.js on lines 40..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 82.

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

      import React, { useState } from 'react';
      import PropTypes from 'prop-types';
      import { useDispatch, useSelector } from 'react-redux';
      import { FormattedMessage } from 'react-intl';
      import {

        Consider simplifying this complex logical expression.
        Open

                      if (id === useCustomizedRex) {
                        dropdownItems.push(
                          <DropdownItem
                            aria-label={`enable-${id}-href`}
                            ouiaId={`enable-${id}-href`}

          Class ContentViewFilter has 22 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class ContentViewFilter < Katello::Model
              include Authorization::ContentViewFilter
              audited :associations => [:repositories], :associated_with => :content_view, :except => [:name, :description]
              DOCKER = 'docker'.freeze
              RPM = Rpm::CONTENT_TYPE
          Severity: Minor
          Found in app/models/katello/content_view_filter.rb - About 2 hrs to fix

            Function CVDeletionFinish has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const CVDeletionFinish = () => {
              const {
                cvId,
                cvEnvironments,
                setIsOpen,
            Severity: Major
            Found in webpack/scenes/ContentViews/Delete/Steps/CVDeletionFinish.js - About 2 hrs to fix

              Method scoped_search has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def scoped_search(query, default_sort_by, default_sort_order, options = {})
                    params[:sort_by] ||= default_sort_by
                    params[:sort_order] ||= default_sort_order
              
                    resource = options[:resource_class] || resource_class
              Severity: Major
              Found in app/controllers/katello/api/v2/api_controller.rb - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language