Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

  const contentViewEligible = (id) => {
    if (id === cvId) {
      return (versionEnvironments.filter(env =>
        env.id === first(selectedEnvForHosts)?.id).length === 0);
    }
webpack/scenes/ContentViews/Details/Versions/BulkDelete/Steps/ReassignActivationKeys.js on lines 73..79

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

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 contentViewEligible = (id) => {
    if (id === cvId) {
      return (versionEnvironments.filter(env =>
        env.id === first(selectedEnvForAK)?.id).length === 0);
    }
webpack/scenes/ContentViews/Details/Versions/BulkDelete/Steps/ReassignHosts.js on lines 77..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 66.

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

angular.module('Bastion.components')
    .directive('bstTable', function () {
        return {
            restrict: 'A',
            replace: true,
engines/bastion/app/assets/javascripts/bastion/components/bst-table.directive.js on lines 12..319

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

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

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

    Function spawnFetch has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const spawnFetch = useCallback((paginationData) => {
        const fetchWithParams = (allParams = {}) => {
          const newRequest = {
            ...(paginationData ?? paginationParams()),
            ...allParams,
    Severity: Minor
    Found in webpack/components/Table/TableWrapper.js - About 1 hr to fix

      Function performRepositorySetAction has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              $scope.performRepositorySetAction = function () {
                  var params, action, success, error, contentOverrides;
      
                  action = $scope.repositorySets.action;
                  params = hostIds;

        Method copy_content_for_source has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def copy_content_for_source(source_repository, options = {})
                  package_filters = [ContentViewPackageGroupFilter, ContentViewPackageFilter].collect do |filter_class|
                    filter_class.where(:id => options[:filter_ids])
                  end
                  package_filters.flatten!.compact!
        Severity: Minor
        Found in app/services/katello/pulp3/repository/yum.rb - About 1 hr to fix

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

                  def plan(smart_proxy, options = {})
                    plan_self(:smart_proxy_id => smart_proxy.id)
                    action_subject(smart_proxy)
                    environment = options[:environment]
                    content_view = options[:content_view]
          Severity: Minor
          Found in app/lib/actions/katello/capsule_content/sync_capsule.rb - About 1 hr to fix

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

                    def run
                      repo = ::Katello::Repository.find(input[:id])
                      if repo.docker?
                        ::Katello::DockerManifest.import_for_repository(repo)
                        ::Katello::DockerTag.import_for_repository(repo)
            Severity: Minor
            Found in app/lib/actions/katello/repository/filtered_index_content.rb - About 1 hr to fix

              Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def initialize(attributes = {})
                  if (!attributes.is_a?(Hash))
                    fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerContainerDistribution` initialize method"
                  end
              
              
              Severity: Minor
              Found in lib/monkeys/remove_hidden_distribution.rb - About 1 hr to fix

                Method invoke_external_task has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        def invoke_external_task
                          repo = ::Katello::Repository.find(input[:repository_id])
                          repo_backend_service = repo.backend_service(smart_proxy)
                          upload_class = repo_backend_service.core_api.upload_class
                          uploads_api = repo_backend_service.core_api.uploads_api
                Severity: Minor
                Found in app/lib/actions/pulp3/repository/upload_file.rb - About 1 hr to fix

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

                    class Pulp < ::ProxyAPI::Resource
                      def initialize(args)
                        @url = args[:url] + "/pulp/status"
                        super args
                      end
                  Severity: Major
                  Found in lib/proxy_api/pulp.rb and 1 other location - About 1 hr to fix
                  lib/proxy_api/pulp_node.rb on lines 2..20

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

                  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

                    class PulpNode < ::ProxyAPI::Resource
                      def initialize(args)
                        @url = args[:url] + "/pulpnode/status"
                        super args
                      end
                  Severity: Major
                  Found in lib/proxy_api/pulp_node.rb and 1 other location - About 1 hr to fix
                  lib/proxy_api/pulp.rb on lines 2..20

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                          $scope.errorHandler = function (response) {
                              angular.forEach(response.data.errors, function (responseError) {
                                  Notification.setErrorMessage(responseError);
                              });
                              $scope.working = false;
                  engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs.controller.js on lines 30..35

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                    await patientlyWaitFor(() => {
                      expect(queryByText('Select a lifecycle environment from the available promotion paths to promote new version.')).toBeNull();
                      expect(getByText(`Version ${firstVersion.version}`)).toBeInTheDocument();
                    });
                  webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 365..368

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                    await patientlyWaitFor(() => {
                      expect(queryByText('Select a lifecycle environment from the available promotion paths to promote new version.')).toBeNull();
                      expect(getByText(`Version ${firstVersion.version}`)).toBeInTheDocument();
                    });
                  webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js on lines 265..268

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                          $scope.errorHandler = function (response) {
                              angular.forEach(response.data.errors, function (responseError) {
                                  Notification.setErrorMessage(responseError);
                              });
                              $scope.working = false;
                  engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js on lines 33..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 65.

                  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

                  export const katelloPackageInstallBySearchUrl = ({ hostname, hostSearch, search }) => createJob({
                    hostname,
                    hostSearch,
                    feature: REX_FEATURES.KATELLO_PACKAGE_INSTALL_BY_SEARCH,
                    inputs: { [PACKAGE_SEARCH_QUERY]: search },
                  webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js on lines 36..41
                  webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js on lines 64..69

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

                  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

                  export const katelloPackageRemoveBySearchUrl = ({ hostname, hostSearch, search }) => createJob({
                    hostname,
                    hostSearch,
                    feature: REX_FEATURES.KATELLO_PACKAGES_REMOVE_BY_SEARCH,
                    inputs: { [PACKAGES_SEARCH_QUERY]: search },
                  webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js on lines 29..34
                  webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js on lines 64..69

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

                  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

                      <Row>
                        <Col sm={3}>{__('Repo Type')}</Col>
                        <Col sm={9}>{content.type} </Col>
                      </Row>
                  webpack/scenes/Subscriptions/Details/SubscriptionDetailProduct.js on lines 13..16
                  webpack/scenes/Subscriptions/Details/SubscriptionDetailProduct.js on lines 17..20

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

                  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