Katello/katello

View on GitHub

Showing 2,650 of 2,650 total issues

Function ErrataTab has 515 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function RepositorySetsTab has 481 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const RepositorySetsTab = () => {
      const hostDetails = useSelector(state => selectAPIResponse(state, 'HOST_DETAILS'));
      const {
        id: hostId,
        content_facet_attributes: contentFacetAttributes,

      Function PackagesTab has 461 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const PackagesTab = () => {
        const hostDetails = useSelector(state => selectAPIResponse(state, 'HOST_DETAILS'));
        const {
          id: hostId,
          name: hostname,

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

        test('Can bulk upgrade via customized remote execution', async (done) => {
          const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
        
          const scope = nockInstance
            .get(hostDebs)
        webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js on lines 306..343

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

        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 bulk upgrade via customized remote execution', async (done) => {
          const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
        
          const scope = nockInstance
            .get(hostPackages)
        webpack/components/extensions/HostDetails/Tabs/__tests__/debsTab.test.js on lines 305..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 394.

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

        export const ModuleStreamsTab = () => {
          const hostDetails = useSelector(selectHostDetails);
          const { id: hostId, name: hostname } = hostDetails;
          const showActions = can(invokeRexJobs, userPermissionsFromHostDetails({ hostDetails }));
          const [useCustomizedRex, setUseCustomizedRex] = useState('');

          File chosen.jquery.js has 878 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // Chosen, a Select Box Enhancer for jQuery and Protoype
          // by Patrick Filler for Harvest, http://getharvest.com
          //
          // Version 0.9.5
          // Full source at https://github.com/harvesthq/chosen
          Severity: Major
          Found in app/assets/javascripts/katello/common/chosen.jquery.js - About 2 days to fix

            Function DebsTab has 422 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

              test('Uses package_install_by_search_query template when in select all mode', async (done) => {
                const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
                const scope = nockInstance
                  .get(hostYumInstallablePackages)
                  .query(defaultQuery)
              webpack/components/extensions/HostDetails/Tabs/__tests__/debsInstallModal.test.js on lines 189..225

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

              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('Uses packages_install_by_search_query template when in select all mode', async (done) => {
                const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
                const scope = nockInstance
                  .get(hostInstallableDebs)
                  .query(defaultQuery)
              webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js on lines 191..227

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

              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 install a package via customized remote execution', async (done) => {
                const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
                const scope = nockInstance
                  .get(hostYumInstallablePackages)
                  .query(defaultQuery)
              webpack/components/extensions/HostDetails/Tabs/__tests__/debsInstallModal.test.js on lines 152..187

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

              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 install a deb package via customized remote execution', async (done) => {
                const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
                const scope = nockInstance
                  .get(hostInstallableDebs)
                  .query(defaultQuery)
              webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js on lines 154..189

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

              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 (
                              <Tr key={id} ouiaId={`action-row-${id}`}>
                                {showActions ? (
                                  <Td
                                    select={{
              webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.js on lines 523..565

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

              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 (
                              <Tr key={id} ouiaId={`action-row-${id}`}>
                                {showActions ? (
                                  <Td
                                    select={{
              webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js on lines 566..608

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

              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 repository.rb has 840 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module Katello
                # rubocop:disable Metrics/ClassLength
                class Repository < Katello::Model
                  audited
              
              
              Severity: Major
              Found in app/models/katello/repository.rb - About 2 days to fix

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

                  class Repository < Katello::Model
                    audited
                
                    #pulp uses pulp id to sync with 'yum_distributor' on the end
                    PULP_ID_MAX_LENGTH = 220
                Severity: Major
                Found in app/models/katello/repository.rb - About 2 days to fix

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

                  test('Can install a deb package via remote execution', async (done) => {
                    const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
                    const scope = nockInstance
                      .get(hostInstallableDebs)
                      .query(defaultQuery)
                  webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js on lines 118..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 354.

                  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 install a package via remote execution', async (done) => {
                    const autocompleteScope = mockForemanAutocomplete(nockInstance, autocompleteUrl);
                    const scope = nockInstance
                      .get(hostYumInstallablePackages)
                      .query(defaultQuery)
                  webpack/components/extensions/HostDetails/Tabs/__tests__/debsInstallModal.test.js on lines 116..150

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 354.

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

                  const ACSTable = () => {
                    const response = useSelector(selectAlternateContentSources);
                    const status = useSelector(selectAlternateContentSourcesStatus);
                    const error = useSelector(selectAlternateContentSourcesError);
                    const resolved = status === STATUS.RESOLVED;
                  Severity: Major
                  Found in webpack/scenes/AlternateContentSources/MainTable/ACSTable.js - About 1 day to fix

                    Function Nutupane has 372 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            var Nutupane = function (resource, params, action, nutupaneParams) {
                                var locationPage, self = this;
                    
                                function getTableName() {
                                    return self.tableName || $location.path().split('/').join('-').slice(1);
                      Severity
                      Category
                      Status
                      Source
                      Language