Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

  const selectionToolbar = (
    <ToolbarItem key="selectAll">
      <SelectAllCheckbox
        {...{
          selectNone,
webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/02_BulkErrataTable.js on lines 65..82

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

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 selectionToolbar = (
    <ToolbarItem key="selectAll">
      <SelectAllCheckbox
        {...{
          selectNone,
webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/02_BulkPackagesTable.js on lines 73..90

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

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 hostTreeViewData = [
    {
      name: __('Hosts'),
      id: 'packages-host-treeview-title',
      customBadgeContent: currentSelectedHostsCount,
webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_Review.js on lines 70..91

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

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

  const dropdownUpgradeItems = [
    <DropdownItem
      aria-label="bulk_upgrade_rex"
      ouiaId="bulk_upgrade_rex"
      key="bulk_upgrade_rex"
webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js on lines 359..378

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

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

  const dropdownUpgradeItems = [
    <DropdownItem
      aria-label="bulk_upgrade_rex"
      ouiaId="bulk_upgrade_rex"
      key="bulk_upgrade_rex"
webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.js on lines 327..346

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

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.openSyncPlanModal = function () {
            nutupane.invalidate();
            $uibModal.open({
                templateUrl: 'products/bulk/views/products-bulk-sync-plan-modal.html',
                controller: 'ProductsBulkSyncPlanModalController',
engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js on lines 147..161

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

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.openHttpProxyModal = function () {
            nutupane.invalidate();
            $uibModal.open({
                templateUrl: 'products/bulk/views/products-bulk-http-proxy-modal.html',
                controller: 'ProductsBulkHttpProxyModalController',
engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js on lines 131..145

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

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

Consider simplifying this complex logical expression.
Open

if (!document.createElement('canvas').getContext) {

(function() {

  // alias some functions to make (compiled) code shorter
Severity: Critical
Found in app/assets/javascripts/katello/html5/excanvas.js - About 3 hrs to fix

    Class KTEnvironment has 28 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class KTEnvironment < Katello::Model
        audited :associations => [:content_facets]
        include ForemanTasks::Concerns::ActionSubject
        include Authorization::LifecycleEnvironment
    
    
    Severity: Minor
    Found in app/models/katello/kt_environment.rb - About 3 hrs to fix

      Class HostsBulkActionsController has 28 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Api::V2::HostsBulkActionsController < Api::V2::ApiController
          include ::Api::V2::BulkHostsExtension
          include Katello::Concerns::Api::V2::ContentOverridesController
          include Katello::ContentSourceHelper
          include ::Foreman::Renderer::Scope::Macros::Base
      Severity: Minor
      Found in app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb - About 3 hrs to fix

        Class ActivationKeysController has 28 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class Api::V2::ActivationKeysController < Api::V2::ApiController  # rubocop:disable Metrics/ClassLength
            include Katello::Concerns::FilteredAutoCompleteSearch
            include Katello::Concerns::Api::V2::ContentOverridesController
            include Katello::Concerns::Api::V2::MultiCVParamsHandling
            before_action :verify_presence_of_organization_or_environment, :only => [:index]
        Severity: Minor
        Found in app/controllers/katello/api/v2/activation_keys_controller.rb - About 3 hrs to fix

          Class Yum has 28 methods (exceeds 20 allowed). Consider refactoring.
          Open

                class Yum < ::Katello::Pulp3::Repository
                  include Katello::Util::Errata
                  include Katello::Util::PulpcoreContentFilters
          
                  UNIT_LIMIT = 10_000
          Severity: Minor
          Found in app/services/katello/pulp3/repository/yum.rb - About 3 hrs to fix

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

            PulpRpmClient::RpmRpmDistribution.class_eval do
              # Initializes the object
              # @param [Hash] attributes Model attributes in the form of hash
              def initialize(attributes = {})
                if (!attributes.is_a?(Hash))
            Severity: Major
            Found in lib/monkeys/remove_hidden_distribution.rb and 3 other locations - About 3 hrs to fix
            lib/monkeys/remove_hidden_distribution.rb on lines 231..277
            lib/monkeys/remove_hidden_distribution.rb on lines 282..328
            lib/monkeys/remove_hidden_distribution.rb on lines 334..380

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

            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

            PulpFileClient::FileFileDistribution.class_eval do
              # Initializes the object
              # @param [Hash] attributes Model attributes in the form of hash
              def initialize(attributes = {})
                if (!attributes.is_a?(Hash))
            Severity: Major
            Found in lib/monkeys/remove_hidden_distribution.rb and 3 other locations - About 3 hrs to fix
            lib/monkeys/remove_hidden_distribution.rb on lines 121..167
            lib/monkeys/remove_hidden_distribution.rb on lines 282..328
            lib/monkeys/remove_hidden_distribution.rb on lines 334..380

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

            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

            PulpOstreeClient::OstreeOstreeDistribution.class_eval do
              # Initializes the object
              # @param [Hash] attributes Model attributes in the form of hash
              def initialize(attributes = {})
                if (!attributes.is_a?(Hash))
            Severity: Major
            Found in lib/monkeys/remove_hidden_distribution.rb and 3 other locations - About 3 hrs to fix
            lib/monkeys/remove_hidden_distribution.rb on lines 121..167
            lib/monkeys/remove_hidden_distribution.rb on lines 231..277
            lib/monkeys/remove_hidden_distribution.rb on lines 282..328

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

            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

            PulpDebClient::DebAptDistribution.class_eval do
              # Initializes the object
              # @param [Hash] attributes Model attributes in the form of hash
              def initialize(attributes = {})
                if (!attributes.is_a?(Hash))
            Severity: Major
            Found in lib/monkeys/remove_hidden_distribution.rb and 3 other locations - About 3 hrs to fix
            lib/monkeys/remove_hidden_distribution.rb on lines 121..167
            lib/monkeys/remove_hidden_distribution.rb on lines 231..277
            lib/monkeys/remove_hidden_distribution.rb on lines 334..380

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

            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 bulkRemove = () => {
                setBulkActionOpen(false);
                const packageFilterIds =
                  rows.filter(({ selected, added }) =>
                    selected && added).map(({ packagefilterId }) => packagefilterId);
            webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js on lines 151..159

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

            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 bulkRemove = () => {
                setBulkActionOpen(false);
                const moduleStreamRuleIds =
                  rows.filter(({ selected, added }) =>
                    selected && added).map(({ moduleStreamRuleId }) => moduleStreamRuleId);
            webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js on lines 143..151

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

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

                    def plan(old_version, environments, options = {})
                      dep_solve = options.fetch(:resolve_dependencies, true)
                      description = options.fetch(:description, '')
                      content = options.fetch(:content, {})
                      new_components = options.fetch(:new_components, [])
            Severity: Major
            Found in app/lib/actions/katello/content_view_version/incremental_update.rb - About 3 hrs to fix

              Method product_permissions has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def product_permissions
                    @plugin.permission :view_products,
                                       {
                                         'katello/products' => [:auto_complete, :auto_complete_search],
                                         'katello/api/v2/products' => [:index, :show, :auto_complete_search],
              Severity: Major
              Found in lib/katello/permission_creator.rb - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language