Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

                products: {
                    method: "GET",
                    transformResponse: function(data) {
                        var allProducts = parseContentCredentialData(data, productTypeMap);
                        return {
engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credential.factory.js on lines 62..72
engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credential.factory.js on lines 84..94

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                repositories: {
                    method: "GET",
                    transformResponse: function(data) {
                        var allRepos = parseContentCredentialData(data, repoTypeMap);
                        return {
engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credential.factory.js on lines 62..72
engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credential.factory.js on lines 73..83

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

          {security !== undefined &&
            <FlexItem>
              <SecurityIcon color="#0066cc" />
              <Link to={hostErrataUrl('security')}>{security}</Link>
            </FlexItem>
Severity: Major
Found in webpack/ForemanColumnExtensions/index.js and 2 other locations - About 1 hr to fix
webpack/ForemanColumnExtensions/index.js on lines 45..50
webpack/ForemanColumnExtensions/index.js on lines 51..56

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

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 { queryByText, queryAllByText, getAllByText } = renderWithRedux(
    withCVRoute(<CVVersionCompare
      cvId={4}
      versionIds={versionIdsAllContentTypes}
      versionLabels={versionLabelsAllContentTypes}
webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 399..406

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

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 getAlternateContentSources = (extraParams, id = '') => get({
  type: API_OPERATIONS.GET,
  key: ACS_KEY + id,
  url: api.getApiUrl('/alternate_content_sources'),
  params: createACSParams(extraParams),
Severity: Major
Found in webpack/scenes/AlternateContentSources/ACSActions.js and 1 other location - About 1 hr to fix
webpack/scenes/ContentViews/ContentViewsActions.js on lines 22..27

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

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 getContentViews = (extraParams, id = '') => get({
  type: API_OPERATIONS.GET,
  key: CONTENT_VIEWS_KEY + id,
  url: api.getApiUrl('/content_views'),
  params: createContentViewsParams(extraParams),
Severity: Major
Found in webpack/scenes/ContentViews/ContentViewsActions.js and 1 other location - About 1 hr to fix
webpack/scenes/AlternateContentSources/ACSActions.js on lines 36..41

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

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

          {
            isDeleteModalOpen &&
            <ContentViewDeleteWizard
              cvId={id && Number(id)}
              cvEnvironments={environments}
Severity: Major
Found in webpack/scenes/ContentViews/Table/ContentViewsTable.js and 1 other location - About 1 hr to fix
webpack/scenes/ContentViews/Details/ContentViewDetails.js on lines 237..247

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

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 { queryByText, queryAllByText, getAllByText } = renderWithRedux(
    withCVRoute(<CVVersionCompare
      cvId={4}
      versionIds={versionIdsThreeContentTypes}
      versionLabels={versionLabelsThreeContentTypes}
webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js on lines 335..342

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

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

          <tr>
            <td><b>{__('Limits')}</b></td>
            <td>{subscriptionLimits(subscriptionDetails)}</td>
          </tr>
webpack/scenes/Subscriptions/Details/SubscriptionDetailInfo.js on lines 52..55

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

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

      {
        deleting &&
        <ContentViewDeleteWizard
          cvId={cvId && Number(cvId)}
          cvEnvironments={environments}
Severity: Major
Found in webpack/scenes/ContentViews/Details/ContentViewDetails.js and 1 other location - About 1 hr to fix
webpack/scenes/ContentViews/Table/ContentViewsTable.js on lines 209..219

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

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

          <tr>
            <td><b>{__('Instance-based')}</b></td>
            <td>{formatInstanceBased(subscriptionDetails)}</td>
          </tr>
webpack/scenes/Subscriptions/Details/SubscriptionDetailInfo.js on lines 48..51

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

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

    def_param_group :bulk_errata_ids do
      param :included, Hash, :desc => N_("Errata to exclusively include in the action"), :required => true, :action_aware => true do
        param :search, String, :required => false, :desc => N_("Search string for erratum to perform an action on")
        param :ids, Array, :required => false, :desc => N_("List of errata ids to perform an action on, (ex: RHSA-2019:1168)")
      end
Severity: Major
Found in app/controllers/katello/api/v2/host_errata_controller.rb and 1 other location - About 1 hr to fix
app/controllers/katello/api/v2/content_views_controller.rb on lines 29..38

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

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

    def_param_group :bulk_content_view_version_ids do
      param :included, Hash, :desc => N_("Versions to exclusively include in the action"), :required => true, :action_aware => true do
        param :search, String, :required => false, :desc => N_("Search string for versions to perform an action on")
        param :ids, Array, :required => false, :desc => N_("List of versions to perform an action on")
      end
Severity: Major
Found in app/controllers/katello/api/v2/content_views_controller.rb and 1 other location - About 1 hr to fix
app/controllers/katello/api/v2/host_errata_controller.rb on lines 27..36

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

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

  const buildRows = useCallback(() => {
    const newRows = [];
    const filterRules = filterResults.find(({ id }) => id === Number(filterId))?.rules || [];
    results.forEach((packageGroups) => {
      const {

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

      render() {
        const { moduleStreamDetails } = this.props;
        const {
          loading, name, stream,
        } = moduleStreamDetails;
    Severity: Minor
    Found in webpack/scenes/ModuleStreams/Details/ModuleStreamDetails.js - About 1 hr to fix

      Method katello_name_from_pulpcore_name has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def self.katello_name_from_pulpcore_name(pulpcore_name, repo)
              # Counts shouldn't be needed for more than the default generic content unit type.
              if repo.generic?
                generic_unit = repo.repository_type.default_managed_content_type
                if pulpcore_name == generic_unit.pulpcore_name
      Severity: Minor
      Found in app/services/katello/pulp3/pulp_content_unit.rb - About 1 hr to fix

        Method get has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def get(path, _headers = {})
                  net = http_downloader
                  path = File.join(@uri.request_uri, path)
                  used_url = File.join("#{@uri.scheme}://#{@uri.host}:#{@uri.port}", path)
                  Rails.logger.info "CDN: Requesting path #{used_url}"
        Severity: Minor
        Found in app/lib/katello/resources/cdn.rb - About 1 hr to fix

          Method copy_content_from_mapping has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def copy_content_from_mapping(repo_id_map, options = {})
                    repo_id_map.each do |source_repo_ids, dest_repo_map|
                      filters = [ContentViewErratumFilter, ContentViewPackageGroupFilter, ContentViewPackageFilter].collect do |filter_class|
                        filter_class.where(:id => dest_repo_map[:filter_ids])
                      end
          Severity: Minor
          Found in app/services/katello/pulp3/repository/yum.rb - About 1 hr to fix

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

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

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

                      def plan(repo, options = {})
                        action_subject(repo)
                        repo.check_ready_to_act!
              
                        validate_contents = options.fetch(:validate_contents, false)
              Severity: Minor
              Found in app/lib/actions/katello/repository/sync.rb - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language