Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

  module Katello
    module JailConcern
      module Organization
        def organization_id
          input['organization']['id']
Severity: Major
Found in app/lib/actions/katello/jail_concern/organization.rb and 1 other location - About 1 hr to fix
app/lib/actions/katello/jail_concern/content_view.rb on lines 2..24

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

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

    updateProduct = function (prod_id, done, percent, size) {
      var product_element = $("#product-" + prod_id),
        element = product_element.find(".result"),
        oldpg = element.find(".progress");

Severity: Minor
Found in app/assets/javascripts/katello/sync_management/sync_management.js - About 1 hr to fix

    Function update_content_views has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            update_content_views = function(env_ids) {
                if (env_ids.length === 0) {
                    clear_content_views();
                } else {
                    // retrieve the list of views in this environment and update the options
    Severity: Minor
    Found in app/assets/javascripts/katello/widgets/env_content_view_selector.js - About 1 hr to fix

      Function loadRepositorySets has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const loadRepositorySets = (extendedParams = {}) => async (dispatch, getState) => {
        dispatch({ type: REPOSITORY_SETS_REQUEST, params: extendedParams });
        // Assemble params
        const { recommended } = getState().katello.redHatRepositories.sets;
        const searchParams = extendedParams.search || {};
      Severity: Minor
      Found in webpack/redux/actions/RedHatRepositories/sets.js - About 1 hr to fix

        Function actionsWithPermissions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const actionsWithPermissions = (cvInfo) => {
            const { version_count: cvVersionCount, generated_for: generatedFor, permissions } = cvInfo;
        
            const publishAction = {
              title: __('Publish'),
        Severity: Minor
        Found in webpack/scenes/ContentViews/Table/ContentViewsTable.js - About 1 hr to fix

          Method update_content_counts! has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def update_content_counts!
                  # {:content_view_versions=>{87=>{:repositories=>{1=>{:metadata=>{},:counts=>{:rpms=>98, :module_streams=>9898}}}}}
                  new_content_counts = { content_view_versions: {} }
                  smart_proxy_helper = ::Katello::SmartProxyHelper.new(self)
                  repos = smart_proxy_helper.repositories_available_to_capsule
          Severity: Minor
          Found in app/models/katello/concerns/smart_proxy_extensions.rb - About 1 hr to fix

            Method import_package_profile_in_bulk has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def import_package_profile_in_bulk(simple_packages)
                    nvreas = simple_packages.map { |sp| sp.nvrea }
                    found_nvrea = InstalledPackage.where(:nvrea => nvreas)
                    nil_vendor_installed_packages = found_nvrea.where(vendor: nil)
                    unless nil_vendor_installed_packages.blank?
            Severity: Minor
            Found in app/models/katello/concerns/host_managed_extensions.rb - About 1 hr to fix

              Function removeHostCollections has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      $scope.removeHostCollections = function (host) {
                          var deferred = $q.defer(),
                              success,
                              error,
                              data,

                Function addHostCollections has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        $scope.addHostCollections = function () {
                            var data,
                                success,
                                error,
                                deferred = $q.defer(),

                  Method import_content_view_params has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def import_content_view_params
                            generated_for = metadata_map.content_view.generated_for
                  
                            if generated_for.blank?
                              generated_for = if metadata_map.content_view.label.start_with?(::Katello::ContentView::EXPORT_LIBRARY)
                  Severity: Minor
                  Found in app/services/katello/pulp3/content_view_version/import.rb - About 1 hr to fix

                    Method refresh_distributions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def refresh_distributions
                            if repo.docker?
                              dist = lookup_distributions(base_path: repo.container_repository_name).first
                            else
                              dist = lookup_distributions(base_path: repo.relative_path).first
                    Severity: Minor
                    Found in app/services/katello/pulp3/repository.rb - About 1 hr to fix

                      Method main has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            def main
                              bad_hgs = []
                              good_hgs = []
                      
                              groups = interested_hostgroups.each do |hg|
                      Severity: Minor
                      Found in app/lib/katello/util/hostgroup_facets_helper.rb - About 1 hr to fix

                        Method lifecycle_environment_permissions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def lifecycle_environment_permissions
                              @plugin.permission :view_lifecycle_environments,
                                                 {
                                                   'katello/api/v2/environments' => [:index, :show, :paths, :repositories, :auto_complete_search],
                                                   'katello/api/rhsm/candlepin_proxies' => [:rhsm_index]
                        Severity: Minor
                        Found in lib/katello/permission_creator.rb - About 1 hr to fix

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

                                        KT.content.updateRepo(
                                          repo.id,
                                          repo.start_time,
                                          repo.duration,
                                          repo.progress.progress,
                          app/assets/javascripts/katello/sync_management/sync_management.js on lines 330..339

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

                          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

                                        KT.content.updateRepo(
                                          repo.id,
                                          repo.start_time,
                                          repo.duration,
                                          repo.progress.progress,
                          app/assets/javascripts/katello/sync_management/sync_management.js on lines 310..319

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

                          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

                                      <Radio
                                        isChecked={selectedAction === UPGRADE}
                                        name="packageActionRadioGroup"
                                        onChange={() => setSelectedAction(UPGRADE)}
                                        label={__('Upgrade packages')}
                          webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js on lines 187..194
                          webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js on lines 203..210
                          webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js on lines 211..218

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

                          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

                                      <Radio
                                        isChecked={selectedAction === INSTALL}
                                        name="packageActionRadioGroup"
                                        onChange={() => setSelectedAction(INSTALL)}
                                        label={__('Install packages')}
                          webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js on lines 187..194
                          webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js on lines 195..202
                          webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js on lines 211..218

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

                          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

                                      <Radio
                                        isChecked={selectedAction === UPGRADE_ALL}
                                        name="packageActionRadioGroup"
                                        onChange={() => setSelectedAction(UPGRADE_ALL)}
                                        label={__('Upgrade all packages')}
                          webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js on lines 195..202
                          webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js on lines 203..210
                          webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js on lines 211..218

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

                          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

                              <DropdownItem
                                aria-label="apply_via_remote_execution"
                                ouiaId="apply_via_remote_execution"
                                key="apply_via_remote_execution"
                                component="button"
                          webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js on lines 407..416
                          webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js on lines 417..426
                          webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js on lines 427..436

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

                          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

                              <DropdownItem
                                aria-label="bulk_enable"
                                key="bulk_enable"
                                ouiaId="bulk_enable"
                                component="button"
                          webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js on lines 309..318
                          webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js on lines 417..426
                          webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js on lines 427..436

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

                          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