Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

      {
        id: 3,
        name: 'test',
        label: 'test',
        publish_date: '4 days',
webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 293..306

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

const Table = ({
  emptyState,
  tableColumns,
  subscriptions,
  loadSubscriptions,
webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js on lines 31..308

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

Function search_field_scale has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Chosen.prototype.search_field_scale = function() {
      var dd_top, div, h, style, style_block, styles, w, _i, _len;
      if (this.is_multiple) {
        h = 0;
        w = 0;
Severity: Minor
Found in app/assets/javascripts/katello/common/chosen.jquery.js - About 1 hr to fix

    Function CanvasRenderingContext2D_ has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function CanvasRenderingContext2D_(canvasElement) {
        this.m_ = createMatrixIdentity();
    
        this.mStack_ = [];
        this.aStack_ = [];
    Severity: Minor
    Found in app/assets/javascripts/katello/html5/excanvas.js - About 1 hr to fix

      Function render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          return (
            <div style={{ display: 'flex' }}>
              <DropdownButton title={this.state.searchList.title} id="search-list-select">
                {this.dropDownItems
      Severity: Minor
      Found in webpack/scenes/RedHatRepositories/components/Search.js - About 1 hr to fix

        Function DiscoveryRepositories has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function DiscoveryRepositories() {
                this.rows = [];
                this.repositoryUrl = '';
                this.upstreamUsername = '';
                this.upstreamPassword = '';

          Method safe_render_container_name has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def self.safe_render_container_name(repository, pattern = nil)
                #            pattern provided / env pattern provided
                #                 |  00 |  01 |  11 |  10
                # ----------------+-----+-----+-----+------
                # env exists /  00|   4 | n/a | n/a |   4
          Severity: Minor
          Found in app/models/katello/repository.rb - About 1 hr to fix

            Method run_event has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def run_event(event)
                    Katello::Logging.time("katello event handled") do |data|
                      data[:type] = event.event_type
                      data[:object_id] = event.object_id
                      data[:expired] = false
            Severity: Minor
            Found in app/services/katello/event_monitor/poller_thread.rb - About 1 hr to fix

              Method import_uploads has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def import_uploads
                    generate_metadata = ::Foreman::Cast.to_bool(params.fetch(:publish_repository, true))
                    sync_capsule = ::Foreman::Cast.to_bool(params.fetch(:sync_capsule, true))
                    async = ::Foreman::Cast.to_bool(params.fetch(:async, false))
                    if params['uploads'].empty?
              Severity: Minor
              Found in app/controllers/katello/api/v2/repositories_controller.rb - About 1 hr to fix

                Method components_repo_instances has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        def components_repo_instances(old_version_repo, new_component_versions)
                          # Attempt to locate the repo instance in the new component versions
                          new_repos = nil
                          new_component_versions.map do |cvv|
                            cvv.repositories.each do |component_repo|
                Severity: Minor
                Found in app/lib/actions/katello/content_view_version/incremental_update.rb - About 1 hr to fix

                  Method filtered_pools has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        def filtered_pools(match_attached, match_host, match_installed, no_overlap)
                          if match_host
                            pools = self.available_pools
                          elsif match_attached
                            pools = self.entitlements.map { |ent| ent['pool'] }
                  Severity: Minor
                  Found in app/services/katello/candlepin/consumer.rb - About 1 hr to fix

                    Method finalize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            def finalize # rubocop:disable Metrics/AbcSize
                              content_view = ::Katello::ContentView.find(input[:content_view_id])
                              environment = ::Katello::KTEnvironment.find(input[:environment_id])
                              content_ids = content_view.repos(environment).map(&:content_id).uniq.compact
                              # in case we create new custom repository that doesn't have the
                    Severity: Minor
                    Found in app/lib/actions/candlepin/environment/set_content.rb - About 1 hr to fix

                      Method run has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              def run
                                return if input[:tasks].empty?
                                version_hrefs = input[:tasks].last[:created_resources]
                                repositories = find_repositories(input[:repository_ids])
                      
                      
                      Severity: Minor
                      Found in app/lib/actions/pulp3/repository/save_versions.rb - About 1 hr to fix

                        Method activation_keys_permissions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def activation_keys_permissions
                              @plugin.permission :view_activation_keys,
                                                 {
                                                   'katello/activation_keys' => [:all, :index],
                                                   'katello/api/v2/activation_keys' => [:index, :show, :available_host_collections, :available_releases,
                        Severity: Minor
                        Found in lib/katello/permission_creator.rb - About 1 hr to fix

                          Method run has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  def run
                                    repo = ::Katello::Repository.find(input[:repository_id])
                                    if input[:force_fetch_version]
                                      version_href = fetch_version_href(repo)
                                    elsif input[:repository_details].present?
                          Severity: Minor
                          Found in app/lib/actions/pulp3/repository/save_version.rb - About 1 hr to fix

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

                                    def plan(repository, options = {})
                                      affected_cvv_ids = []
                                      skip_environment_update = options.fetch(:skip_environment_update, false) ||
                                          options.fetch(:organization_destroy, false)
                                      destroy_content = options.fetch(:destroy_content, true)
                            Severity: Minor
                            Found in app/lib/actions/katello/repository/destroy.rb - About 1 hr to fix

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

                                    <DualListSelector
                                      isSearchable
                                      availableOptions={availableOptions}
                                      chosenOptions={productNames}
                                      addAll={onListChange}
                              webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js on lines 35..44
                              webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditProducts.js on lines 79..88
                              webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditSmartProxies.js on lines 90..99

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

                              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

                                  <DropdownItem
                                    aria-label="bulk_remove"
                                    ouiaId="bulk_remove"
                                    key="bulk_remove"
                                    component="button"
                              webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.js on lines 349..358

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

                              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

                                  <DropdownItem
                                    aria-label="bulk_remove"
                                    ouiaId="bulk_remove"
                                    key="bulk_remove"
                                    component="button"
                              webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js on lines 381..390

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

                              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

                                      <DualListSelector
                                        isSearchable
                                        availableOptions={availableOptions}
                                        chosenOptions={acsSmartProxies}
                                        addAll={onListChange}
                              webpack/scenes/AlternateContentSources/Create/Steps/ACSProducts.js on lines 30..39
                              webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js on lines 35..44
                              webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditProducts.js on lines 79..88

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

                              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