Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

        <Text
          ouiaId="ccs-options-description"
        >
          <FormattedMessage
            defaultMessage={__('After configuring Foreman, configuration must also be updated on {hosts}. Choose one of the following options to update {hosts}:')}
webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceTemplate.js on lines 51..93
webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js on lines 155..177

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

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

          <TextContent>
            <Text ouiaId="mpw-step-1-header" component={TextVariants.h2}>
              {__('Select action')}
            </Text>
            <Text ouiaId="mpw-step-1-content" component={TextVariants.p}>
webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/02_BulkErrataTable.js on lines 120..127
webpack/components/extensions/Hosts/BulkActions/HostReview.js on lines 103..110

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

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

                        <Alert
                          ouiaId="manifest-expiring-soon-alert"
                          variant="warning"
                          title={__('Manifest expiring soon')}
                        >
webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceForm.js on lines 245..265
webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceTemplate.js on lines 51..93

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

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

  cdnConfiguration: PropTypes.shape({
    type: PropTypes.string,
    url: PropTypes.string,
    username: PropTypes.string,
    upstream_organization_label: PropTypes.string,
webpack/scenes/SmartProxy/AdditionalCapsuleContent.js on lines 85..94

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

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

  counts: PropTypes.shape({
    deb: PropTypes.number,
    docker_manifest: PropTypes.number,
    docker_manifest_list: PropTypes.number,
    docker_tag: PropTypes.number,
Severity: Major
Found in webpack/scenes/SmartProxy/AdditionalCapsuleContent.js and 1 other location - About 2 hrs to fix
webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/index.js on lines 91..100

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

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

  render() {
    const { displayArch, releasever, type } = this.props;

    const archLabel = displayArch || __('Unspecified');
    const releaseverLabel = releasever || '';

    Method plan has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def plan(opts = {})
                options = {
                  content_view_version: nil, destination_server: nil,
                  chunk_size: nil, from_history: nil,
                  validate_incremental: true,
    Severity: Major
    Found in app/lib/actions/pulp3/orchestration/content_view_version/export.rb - About 2 hrs to fix

      Class RepositoryMapper has 23 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class RepositoryMapper
            attr_reader :product, :content, :substitutions
      
            def initialize(product, content, substitutions)
              @product = product
      Severity: Minor
      Found in app/models/katello/candlepin/repository_mapper.rb - About 2 hrs to fix

        Class ApiController has 23 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class Api::V2::ApiController < ::Api::V2::BaseController
            include Concerns::Api::ApiController
            include Api::Version2
            include Api::V2::Rendering
            include Api::V2::ErrorHandling
        Severity: Minor
        Found in app/controllers/katello/api/v2/api_controller.rb - About 2 hrs to fix

          Class RegistrationManager has 23 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class RegistrationManager
              class << self
                private :new
                delegate :propose_existing_hostname, :new_host_from_facts, to: Katello::Host::SubscriptionFacet
          
          
          Severity: Minor
          Found in app/services/katello/registration_manager.rb - About 2 hrs to fix

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

                      <Thead>
                        <Tr ouiaId="header-tr">
                          <Th key="select-all" />
                          <SortableColumnHeaders
                            columnHeaders={columnHeaders}
            webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js on lines 234..244

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

            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

                    <Thead>
                      <Tr ouiaId="row-header">
                        <Th key="select_checkbox" />
                        <SortableColumnHeaders
                          columnHeaders={columnHeaders}
            webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js on lines 594..604

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

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

                Chosen.prototype.winnow_results = function() {
                  var found, option, part, parts, regex, result_id, results, searchText, startTime, startpos, text, zregex, _i, _j, _len, _len2, _ref;
                  startTime = new Date();
                  this.no_results_clear();
                  results = 0;
            Severity: Major
            Found in app/assets/javascripts/katello/common/chosen.jquery.js - About 2 hrs to fix

              File repository_content_controller.rb has 270 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module Katello
                module Concerns
                  module Api::V2::RepositoryContentController
                    extend ActiveSupport::Concern
              
              

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

                                error = function (response) {
                                    deferred.reject(response.data.errors);
                                    angular.forEach(response.data.errors, function (responseError) {
                                        Notification.setErrorMessage(responseError);
                                    });
                engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-host-collections.controller.js on lines 62..68
                engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-host-collections.controller.js on lines 61..67

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

                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

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

                            error = function (response) {
                                deferred.reject(response.data.errors);
                                angular.forEach(response.data.errors, function (responseError) {
                                    Notification.setErrorMessage(responseError);
                                });
                engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-host-collections.controller.js on lines 61..67
                engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-products.controller.js on lines 63..69

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

                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

                export const LabelImportOnly = () => (
                  <Flex>
                    <FlexItem spacer={{ default: 'spacerSm' }}>{__('Import only')}</FlexItem>
                    <FlexItem>
                      <HelpToolTip tooltip={importOnlyHelpText} />
                webpack/scenes/ContentViews/Create/ContentViewFormComponents.js on lines 34..41
                webpack/scenes/ContentViews/Create/ContentViewFormComponents.js on lines 43..50
                webpack/scenes/ContentViews/Create/ContentViewFormComponents.js on lines 61..68

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

                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

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

                            error = function (response) {
                                deferred.reject(response.data.errors);
                                angular.forEach(response.data.errors, function (responseError) {
                                    Notification.setErrorMessage(responseError);
                                });
                engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-host-collections.controller.js on lines 62..68
                engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-products.controller.js on lines 63..69

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

                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

                export const LabelAutoPublish = () => (
                  <Flex>
                    <FlexItem spacer={{ default: 'spacerSm' }}>{__('Auto publish')}</FlexItem>
                    <FlexItem>
                      <HelpToolTip tooltip={autoPublishHelpText} />
                webpack/scenes/ContentViews/Create/ContentViewFormComponents.js on lines 34..41
                webpack/scenes/ContentViews/Create/ContentViewFormComponents.js on lines 52..59
                webpack/scenes/ContentViews/Create/ContentViewFormComponents.js on lines 61..68

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

                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

                export const LabelGenerated = () => (
                  <Flex>
                    <FlexItem spacer={{ default: 'spacerSm' }}>{__('Generated')}</FlexItem>
                    <FlexItem>
                      <HelpToolTip tooltip={generatedContentViewHelpText} />
                webpack/scenes/ContentViews/Create/ContentViewFormComponents.js on lines 34..41
                webpack/scenes/ContentViews/Create/ContentViewFormComponents.js on lines 43..50
                webpack/scenes/ContentViews/Create/ContentViewFormComponents.js on lines 52..59

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

                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