Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

        $scope.availableSchemaVersions = function (tag) {
            var versions = [];
            if (tag.manifest_schema1) {
                versions.push(1);
            }
engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js on lines 140..150

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

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

  try {
    const { data } = await api.post(`/organizations/${orgId()}/upstream_subscriptions`, params);
    return dispatch({
      type: SAVE_UPSTREAM_SUBSCRIPTIONS_SUCCESS,
      response: data,
webpack/scenes/Subscriptions/SubscriptionActions.js on lines 127..135

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

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

  try {
    const { data } = await api.put(`/organizations/${orgId()}/upstream_subscriptions`, params);
    return dispatch({
      type: UPDATE_QUANTITY_SUCCESS,
      response: data,
Severity: Major
Found in webpack/scenes/Subscriptions/SubscriptionActions.js and 1 other location - About 2 hrs to fix
webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js on lines 56..64

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

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.getNoRowsMessage = function () {
            var messages = [ContentService.getNoRowsMessage()];
            if ($scope.contentView.id === '') {
                messages.push($scope.getNoContentViewMessage());
            }
engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment-content.controller.js on lines 111..117

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

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.getZeroResultsMessage = function () {
            var messages = [ContentService.getZeroResultsMessage()];
            if ($scope.contentView.id === '') {
                messages.push($scope.getNoContentViewMessage());
            }
engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment-content.controller.js on lines 99..105

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

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

    var checkboxChanged = function(checkbox) {
      var this_checkbox = $(checkbox);
      this_checkbox.attr("disabled", "disabled");
      //var for all favorite icons to clear them
      var all_favorites = $('.favorite');
Severity: Major
Found in app/assets/javascripts/katello/common/katello.js - About 2 hrs to fix

    Function bastionRouting has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function bastionRouting($stateProvider, $urlRouterProvider, $locationProvider) {
            var oldBrowserBastionPath = '/bastion#', getRootPath, shouldRemoveTrailingSlash;
    
            getRootPath = function (path) {
                var rootPath = null;
    Severity: Major
    Found in engines/bastion/app/assets/javascripts/bastion/routing.module.js - About 2 hrs to fix

      Method load_errata_applications has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def load_errata_applications(filter_errata_type: nil, include_last_reboot: 'yes', since: nil, up_to: nil, status: nil, host_filter: nil)
              result = []
      
              filter_errata_type = filter_errata_type.presence || 'all'
              search_up_to = up_to.present? ? "ended_at < \"#{up_to}\"" : nil
      Severity: Major
      Found in app/lib/katello/concerns/base_template_scope_extensions.rb - About 2 hrs to fix

        File AffectedRepositoryTable.js has 259 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { useState, useCallback } from 'react';
        import useDeepCompareEffect from 'use-deep-compare-effect';
        import { useSelector, shallowEqual, useDispatch } from 'react-redux';
        import {
          Bullseye,

          File content-hosts.routes.js has 259 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * @ngdoc object
           * @name Bastion.content-hosts.config
           *
           * @requires $stateProvider

            Function IncrementalUpdate has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function IncrementalUpdate($q, $httpParamSerializer, Task, CurrentOrganization) {
                    var getIdsFromBulk;
            
                    getIdsFromBulk = function (bulkResource) {
                        var ids = [];

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

              beforeEach(() => {
                const { results } = mockEnvPaths;
                [firstEnvPath] = results;
                const { environments: envResults } = firstEnvPath;
                [firstEnv] = envResults;
              webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/__tests__/changeHostCVModal.test.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 79.

              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

              beforeEach(() => {
                const { results } = mockEnvPaths;
                [firstEnvPath] = results;
                const { environments: envResults } = firstEnvPath;
                [firstEnv] = envResults;
              webpack/components/extensions/Hosts/BulkActions/__tests__/bulkChangeHostCVModal.test.js on lines 50..57

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

              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

                        <Modal
                          title={__('Related content views')}
                          ouiaId="related-cvs"
                          variant={ModalVariant.medium}
                          isOpen={isOpen}
              webpack/scenes/ContentViews/expansions/RelatedCompositeContentViewsModal.js on lines 36..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 79.

              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

                    <Modal
                      title={__('Related composite content views')}
                      ouiaId="related-composite-cvs"
                      variant={ModalVariant.large}
                      isOpen={isOpen}
              webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js on lines 51..95

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

              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 SyncPlan has 21 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class SyncPlan < Katello::Model
                  audited :associations => [:products]
                  include Glue
                  include Katello::Authorization::SyncPlan
                  include ForemanTasks::Concerns::ActionSubject
              Severity: Minor
              Found in app/models/katello/sync_plan.rb - About 2 hrs to fix

                Class RhelLifecycleStatus has 21 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  class RhelLifecycleStatus < HostStatus::Status
                    UNKNOWN = 0
                    FULL_SUPPORT = 1
                    MAINTENANCE_SUPPORT = 2
                    APPROACHING_END_OF_MAINTENANCE = 3
                Severity: Minor
                Found in app/models/katello/rhel_lifecycle_status.rb - About 2 hrs to fix

                  Class PulpContentUnit has 21 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                      class PulpContentUnit
                        # Any class that extends this class should define:
                        # Class#update_model
                  
                        # rubocop:disable Metrics/MethodLength
                  Severity: Minor
                  Found in app/services/katello/pulp3/pulp_content_unit.rb - About 2 hrs to fix

                    Class RepositorySetsController has 21 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class Api::V2::RepositorySetsController < Api::V2::ApiController
                        respond_to :json
                    
                        include Katello::Concerns::FilteredAutoCompleteSearch
                    
                    
                    Severity: Minor
                    Found in app/controllers/katello/api/v2/repository_sets_controller.rb - About 2 hrs to fix

                      Class ContentViewVersionsController has 21 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class Api::V2::ContentViewVersionsController < Api::V2::ApiController
                          include ::Api::V2::BulkHostsExtension
                          include Katello::Concerns::FilteredAutoCompleteSearch
                      
                          before_action :find_authorized_katello_resource, :only => [:show, :update, :promote, :destroy, :republish_repositories, :verify_checksum]
                      Severity: Minor
                      Found in app/controllers/katello/api/v2/content_view_versions_controller.rb - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language