Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

Function drawImage has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  contextPrototype.drawImage = function(image, var_args) {
    var dx, dy, dw, dh, sx, sy, sw, sh;

    // to find the original width we overide the width and height
    var oldRuntimeWidth = image.runtimeStyle.width;
Severity: Major
Found in app/assets/javascripts/katello/html5/excanvas.js - About 3 hrs to fix

    File cvModuleStreamFilter.test.js has 295 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from 'react';
    import { renderWithRedux, patientlyWaitFor, fireEvent } from 'react-testing-lib-wrapper';
    import { Route } from 'react-router-dom';
    
    import ContentViewFilterDetails from '../ContentViewFilterDetails';

      Function BulkErrataReviewFooter has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const BulkErrataReviewFooter = () => {
        const {
          finishButtonText,
          finishButtonLoading,
          setFinishButtonLoading,

        File ContentViewDetailSelectors.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { STATUS } from 'foremanReact/constants';
        import {
          selectAPIError,
          selectAPIResponse,
          selectAPIStatus,
        Severity: Minor
        Found in webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js - About 3 hrs to fix

          Function ContentService has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function ContentService($injector, Nutupane, $state, translate) {
                  var contentTypes;
          
                  function currentState() {
                      return $state.current.name.split('.').pop();

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

              render() {
                const { subscriptionDetails } = this.props;
            
            
                const resource = {
            Severity: Major
            Found in webpack/scenes/Subscriptions/Details/SubscriptionDetails.js - About 3 hrs to fix

              File ContentViewDetailsCard.js has 292 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { useState } from 'react';
              import {
                Card,
                CardHeader,
                CardTitle,

                File CVModuleStreamFilterContent.js has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { useState, useEffect, useCallback } from 'react';
                import useDeepCompareEffect from 'use-deep-compare-effect';
                import PropTypes from 'prop-types';
                import { shallowEqual, useSelector, useDispatch } from 'react-redux';
                import { omit } from 'lodash';

                  Function menu has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  KT.menu = (function(){
                    return {
                      menuSetup: function(){
                        //set some useful vars
                        var topLevel = $('#appnav li.top_level');
                  Severity: Major
                  Found in app/assets/javascripts/katello/common/menu.js - About 3 hrs to fix

                    Function AcsUrlPaths has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const AcsUrlPaths = () => {
                      const {
                        acsType, url, setUrl, subpaths, setSubpaths,
                      } = useContext(ACSCreateContext);
                    
                    
                    Severity: Major
                    Found in webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js - About 3 hrs to fix

                      Class Ping has 26 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class Ping
                          OK_RETURN_CODE = 'ok'.freeze
                          FAIL_RETURN_CODE = 'FAIL'.freeze
                          PACKAGES = %w(katello candlepin pulp foreman hammer dynflow).freeze
                      
                      
                      Severity: Minor
                      Found in app/models/katello/ping.rb - About 3 hrs to fix

                        Class RepositoryTypeManager has 26 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                          class RepositoryTypeManager
                            PULP3_FEATURE = "Pulpcore".freeze
                        
                            @defined_repository_types = {}
                            @enabled_repository_types = {}
                        Severity: Minor
                        Found in app/services/katello/repository_type_manager.rb - About 3 hrs to fix

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

                                    {Object.keys(subscriptionAttributes).map(key => (
                                      <tr key={key}>
                                        <td><b>{__(subscriptionAttributes[key])}</b></td>
                                        <td>{subscriptionDetailValue(subscriptionDetails, key)}</td>
                                      </tr>
                          webpack/scenes/Subscriptions/Details/SubscriptionDetailInfo.js on lines 61..66

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

                          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

                            await patientlyWaitFor(() => {
                              expect(queryByText(results[20].name)).toBeInTheDocument();
                              expect(queryByText(results[39].name)).toBeInTheDocument();
                              expect(queryByText(results[41].name)).not.toBeInTheDocument();
                            });
                          webpack/scenes/ContentViews/__tests__/contentViewPage.test.js on lines 216..220

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

                          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

                                    {Object.keys(subscriptionPurposeAttributes).map(key => (
                                      <tr key={key}>
                                        <td><b>{__(subscriptionPurposeAttributes[key])}</b></td>
                                        <td>{subscriptionDetailValue(subscriptionDetails, key)}</td>
                                      </tr>
                          webpack/scenes/Subscriptions/Details/SubscriptionDetailInfo.js on lines 42..47

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

                          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

                          export const moduleStreamAction = ({ hostname, action, moduleSpec }) => post({
                            type: API_OPERATIONS.POST,
                            key: REX_JOB_INVOCATIONS_KEY,
                            url: foremanApi.getApiUrl('/job_invocations'),
                            params: katelloModuleStreamActionsParams({ hostname, action, moduleSpec }),
                          webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js on lines 221..228

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

                          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

                                          {products.map(product =>
                                            (
                                              <ListItem key={product?.id} aria-label="product_value">
                                                <a href={urlBuilder(`products/${product?.id}`, '')}><b>{product?.name}</b></a>
                                              </ListItem>
                          webpack/scenes/AlternateContentSources/Details/ACSExpandableDetails.js on lines 213..218

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 95.

                          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

                          export const removePackages = ({ hostname, search, descriptionFormat }) => post({
                            type: API_OPERATIONS.POST,
                            key: REX_JOB_INVOCATIONS_KEY,
                            url: foremanApi.getApiUrl('/job_invocations'),
                            params: katelloPackagesRemoveParams({ hostname, search, descriptionFormat }),
                          webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js on lines 287..294

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

                          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

                                        {smartProxies?.length > 0 && smartProxies.map(sp =>
                                          (
                                            <ListItem key={sp?.id} aria-label="smartproxy_value">
                                              <a href={urlBuilder(`smart_proxies/${sp?.id}`, '')}><b>{sp?.name}</b></a>
                                            </ListItem>
                          webpack/scenes/AlternateContentSources/Details/ACSExpandableDetails.js on lines 284..289

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

                          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

                            await patientlyWaitFor(() => {
                              expect(queryByText(results[0].name)).toBeInTheDocument();
                              expect(queryByText(results[19].name)).toBeInTheDocument();
                              expect(queryByText(results[21].name)).not.toBeInTheDocument();
                            });
                          webpack/scenes/ContentViews/__tests__/contentViewPage.test.js on lines 228..232

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

                          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