Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

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

      {
        title: __('Product'),
        getProperty: item => (
          <a href={urlBuilder(`products/${item?.product?.id}`, '')}>
            {item?.product?.name}
webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js on lines 120..126
webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js on lines 373..379
webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js on lines 333..339

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

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

    {
      title: __('Remove'),
      onClick: (_event, _rowId, { id }) => {
        dispatch(removeCVFilterRule(filterId, id, () => {
          dispatch(getCVFilterRules(filterId));
webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js on lines 116..124

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

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 4 locations. Consider refactoring.
Open

        {
          title: __('Product'),
          getProperty: item => (
            <a href={urlBuilder(`products/${item?.product?.id}`, '')}>
              {item?.product?.name}
webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js on lines 373..379
webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js on lines 126..132
webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js on lines 333..339

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

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

  await patientlyWaitFor(() => {
    expect(getByText(`name = ${lastPackageGroupName} and`)).toBeInTheDocument();
    expect(queryByText(`name = ${firstPackageGroupName} and`)).not.toBeInTheDocument();
  });
webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js on lines 146..149
webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 140..143

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

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

  await patientlyWaitFor(() => {
    expect(getByText(`name = ${lastComponentName} and`)).toBeInTheDocument();
    expect(queryByText(`name = ${firstComponentName} and`)).not.toBeInTheDocument();
  });
webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js on lines 140..143
webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js on lines 138..141

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

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 4 locations. Consider refactoring.
Open

      {
        title: __('Product'),
        getProperty: item => (
          <a href={urlBuilder(`products/${item?.product?.id}`, '')}>
            {item?.product?.name}
webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js on lines 120..126
webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js on lines 373..379
webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js on lines 126..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 72.

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

  await patientlyWaitFor(() => {
    expect(getByText(`name = ${lastPackageRuleName} and`)).toBeInTheDocument();
    expect(queryByText(`name = ${firstPackageRuleName} and`)).not.toBeInTheDocument();
  });
webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js on lines 146..149
webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js on lines 138..141

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

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

                <Td>{latestVersion ?
                  <ContentViewVersionCell {...{
                    id: cvId,
                    latestVersion,
                    latestVersionId: cvLatestVersionId,
Severity: Major
Found in webpack/scenes/ContentViews/Table/ContentViewsTable.js and 1 other location - About 1 hr to fix
webpack/scenes/ContentViews/Table/tableDataGenerator.js on lines 38..41

Duplicated Code

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

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

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

Tuning

This issue has a mass of 72.

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 katelloPackageRemoveBySearchParams = ({
  hostname, hostSearch, search, descriptionFormat,
}) =>
  baseParams({
    hostname,
webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js on lines 126..134

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

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

        <ActionGroup>
          <Button
            ouiaId="network-sync-configuration-update-button"
            aria-label="update-upstream-configuration"
            variant="secondary"
webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CustomCdnTypeForm.js on lines 116..127

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

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

      <ActionGroup>
        <Button
          ouiaId="custom-cdn-type-configuration-update-button"
          aria-label="update-custom-cdn-configuration"
          variant="secondary"
webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/NetworkSyncForm.js on lines 244..255

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

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 getOrganization = ({ orgId }) => ({
  type: 'API_GET',
  payload: {
    key: `${ORGANIZATION}_${orgId}`,
    url: api.getApiUrl(`/organizations/${orgId}`),
webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js on lines 17..23

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

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 getHostAvailableReleaseVersions = ({ id }) => ({
  type: 'API_GET',
  payload: {
    key: `${AVAILABLE_RELEASE_VERSIONS}_${id}`,
    url: foremanApi.getApiUrl(`/hosts/${id}/subscriptions/available_release_versions`),
webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js on lines 9..15

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

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 katelloHostErrataInstallParams = ({
  hostname, hostSearch, search, descriptionFormat,
}) => baseParams({
  hostname,
  hostSearch,
webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js on lines 84..93

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

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

      title: latestVersion ? <ContentViewVersionCell {...{
        id, latestVersion, latestVersionId, latestVersionEnvironments,
      }}
      /> : <InactiveText style={{ marginTop: '0.5em', marginBottom: '0.5em' }} text={__('Not yet published')} />,
Severity: Major
Found in webpack/scenes/ContentViews/Table/tableDataGenerator.js and 1 other location - About 1 hr to fix
webpack/scenes/ContentViews/Table/ContentViewsTable.js on lines 272..280

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

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

const checkForOuiaIds = () => {
  const ouiaSupportedPFComponents = [
    Alert,
    Breadcrumb,
    Button,
Severity: Minor
Found in webpack/ouia_id_check.js - About 1 hr to fix

    Function onSubmit has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const onSubmit = () => {
        setSaving(true);
        let params = {
          ssl_ca_cert_id: acsCAcert,
          verify_ssl: acsVerifySSL,

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

                def plan(opts = {})
                  content_view_version = opts[:content_view_version]
                  smart_proxy = opts[:smart_proxy]
                  destination_server = opts[:destination_server]
                  from_content_view_version = opts[:from_content_view_version]

        Function set_up_html has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Chosen.prototype.set_up_html = function() {
              var container_div, dd_top, dd_width, sf_width;
              this.container_id = this.form_field.id.length ? this.form_field.id.replace(/(:|\.)/g, '_') : this.generate_field_id();
              this.container_id += "_chzn";
              this.f_width = this.form_field_jq.outerWidth();
        Severity: Minor
        Found in app/assets/javascripts/katello/common/chosen.jquery.js - About 1 hr to fix

          Function ContentDetails has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const ContentDetails = (props) => {
            const { contentDetails, schema } = props;
            const { loading } = contentDetails;
          
            const tabHeaders = () => {
          Severity: Minor
          Found in webpack/components/Content/Details/ContentDetails.js - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language