Katello/katello

View on GitHub

Showing 2,689 of 2,689 total issues

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

  const page = shallow(<SubscriptionsPage
    setModalOpen={noop}
    setModalClosed={noop}
    organization={organization}
    subscriptions={successState}
webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js on lines 66..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 246.

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

test('Sets initial search query from url params', async (done) => {
  // Setup autocomplete with mockForemanAutoComplete since we aren't adding /katello
  const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
  const scope = nockInstance
    .get(hostPackages)
webpack/components/extensions/HostDetails/Tabs/__tests__/debsTab.test.js on lines 400..419

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

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

test('Sets initial search query from url params', async (done) => {
  // Setup autocomplete with mockForemanAutoComplete since we aren't adding /katello
  const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
  const scope = nockInstance
    .get(hostDebs)
webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 401..420

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

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

const TracesTab = () => {
  const hostDetails = useSelector(state => selectAPIResponse(state, 'HOST_DETAILS'));
  const {
    id: hostId,
    name: hostname,
Severity: Major
Found in webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js - About 1 day to fix

    Class Repository has 69 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class Repository
          include Katello::Util::HttpProxy
          include Katello::Pulp3::ServiceCommon
          attr_accessor :repo
          attr_accessor :smart_proxy
    Severity: Major
    Found in app/services/katello/pulp3/repository.rb - About 1 day to fix

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

            columnHeaders: [
              {
                title: __('Name'),
                getProperty: item => (
                  <a href={urlBuilder(`module_streams/${item?.id}`, '')}>
      webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js on lines 151..165

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

      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

            columnHeaders: [
              {
                title: __('Name'),
                getProperty: item => (
                  <a href={urlBuilder(`packages/${item?.id}`, '')}>
      webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js on lines 294..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 234.

      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

      File PackagesTab.js has 574 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { useCallback, useState, useRef } from 'react';
      import { useSelector, useDispatch } from 'react-redux';
      import {
        ActionList,
        ActionListItem,

        File ErrataTab.js has 568 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { useCallback, useState, useMemo } from 'react';
        import useDeepCompareEffect from 'use-deep-compare-effect';
        import { useSelector, useDispatch } from 'react-redux';
        import {
          Split, SplitItem, ActionList, ActionListItem, Dropdown,
        Severity: Major
        Found in webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js - About 1 day to fix

          File ContentViewDetailActions.js has 566 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { API_OPERATIONS, APIActions, get, put, post } from 'foremanReact/redux/API';
          import { translate as __ } from 'foremanReact/common/I18n';
          import { lowerCase } from 'lodash';
          import {
            RPM_PACKAGES_CONTENT,
          Severity: Major
          Found in webpack/scenes/ContentViews/Details/ContentViewDetailActions.js - About 1 day to fix

            Class ContentViewVersion has 64 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class ContentViewVersion < Katello::Model
                include Authorization::ContentViewVersion
                include ForemanTasks::Concerns::ActionSubject
                include Katello::Concerns::SearchByRepositoryName
            
            
            Severity: Major
            Found in app/models/katello/content_view_version.rb - About 1 day to fix

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

                      if (cv !== "") {
                          showSpinner(spinner, true);
                          $.getJSON(url, params)
                              .done(function(data) {
                                      if(data["results"].length > 0) {
              Severity: Major
              Found in app/assets/javascripts/katello/containers/container.js and 1 other location - About 1 day to fix
              app/assets/javascripts/katello/containers/container.js on lines 130..152

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

              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

                      if (env !== "") {
                          showSpinner(spinner, true);
                          $.getJSON(url, params)
                              .done(function(data) {
                                      if (data["results"].length > 0) {
              Severity: Major
              Found in app/assets/javascripts/katello/containers/container.js and 1 other location - About 1 day to fix
              app/assets/javascripts/katello/containers/container.js on lines 168..190

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

              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

              test('Can handle no installable deb packages being present', async (done) => {
                const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
              
                const noResults = {
                  total: 0,
              webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js on lines 85..115

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

              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

              test('Can handle no installable packages being present', async (done) => {
                const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
              
                const noResults = {
                  total: 0,
              webpack/components/extensions/HostDetails/Tabs/__tests__/debsInstallModal.test.js on lines 83..113

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

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

                render() {
                  const {
                    manifestHistory,
                    organization,
                    disableManifestActions,
              Severity: Major
              Found in webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js - About 1 day to fix

                File DebsTab.js has 533 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { useCallback, useState, useRef } from 'react';
                import { useSelector } from 'react-redux';
                import {
                  ActionList,
                  ActionListItem,
                Severity: Major
                Found in webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.js - About 1 day to fix

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

                    return (
                      <>
                        <EnvironmentPaths
                          userCheckedItems={selectedEnvForHost}
                          setUserCheckedItems={setSelectedEnvForHost}
                  webpack/scenes/ContentViews/Delete/Steps/CVDeletionReassignActivationKeysForm.js on lines 96..132

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

                  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

                    return (
                      <>
                        <EnvironmentPaths
                          userCheckedItems={selectedEnvForAK}
                          setUserCheckedItems={setSelectedEnvForAK}
                  webpack/scenes/ContentViews/Delete/Steps/CVDeletionReassignHostsForm.js on lines 98..132

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

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

                  const ACSCredentials = () => {
                    const {
                      acsType, authentication, setAuthentication, username, setUsername, password, setPassword,
                      sslCert, setSslCert, sslKey, setSslKey, caCert, setCACert,
                      setSslCertName, setSslKeyName, setCACertName, verifySSL, setVerifySSL,
                  Severity: Major
                  Found in webpack/scenes/AlternateContentSources/Create/Steps/ACSCredentials.js - About 1 day to fix
                    Severity
                    Category
                    Status
                    Source
                    Language