Katello/katello

View on GitHub
webpack/ForemanColumnExtensions/index.js

Summary

Maintainability
D
2 days
Test Coverage

Function wrapper has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    wrapper: (hostDetails) => {
      const errataCounts = hostDetails?.content_facet_attributes?.errata_counts;
      const registered = !!hostDetails?.subscription_facet_attributes?.uuid;
      const { security, bugfix, enhancement } = errataCounts ?? {};
      const upgradableRpmCount = hostDetails?.content_facet_attributes?.upgradable_package_count;
Severity: Minor
Found in webpack/ForemanColumnExtensions/index.js - About 1 hr to fix

    Function wrapper has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        wrapper: (hostDetails) => {
          const contentViewEnvironments =
            hostDetails?.content_facet_attributes?.content_view_environments ?? [];
          if (contentViewEnvironments.length === 0) return '—'; // don't show popover
          return (
    Severity: Minor
    Found in webpack/ForemanColumnExtensions/index.js - About 1 hr to fix

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

                    <Flex direction={{ default: 'column' }}>
                      {contentViewEnvironments.map(env => (
                        <ContentViewEnvironmentDisplay
                          key={`${env.lifecycle_environment.name}-${env.content_view.name}`}
                          contentView={env.content_view}
      Severity: Major
      Found in webpack/ForemanColumnExtensions/index.js and 1 other location - About 3 hrs to fix
      webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ContentViewDetailsCard.js on lines 169..177

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

      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

        {
          columnName: 'registered_at',
          title: __('Registered at'),
          wrapper: (hostDetails) => {
            const registeredAt = hostDetails?.subscription_facet_attributes?.registered_at;
      Severity: Major
      Found in webpack/ForemanColumnExtensions/index.js and 1 other location - About 1 hr to fix
      webpack/ForemanColumnExtensions/index.js on lines 69..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 73.

      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

        {
          columnName: 'last_checkin',
          title: __('Last seen'),
          wrapper: (hostDetails) => {
            const lastCheckin =
      Severity: Major
      Found in webpack/ForemanColumnExtensions/index.js and 1 other location - About 1 hr to fix
      webpack/ForemanColumnExtensions/index.js on lines 154..163

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

      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

        {
          columnName: 'lifecycle_environment',
          title: __('Lifecycle environment'),
          wrapper: (hostDetails) => {
            const lifecycleEnvironment =
      Severity: Major
      Found in webpack/ForemanColumnExtensions/index.js and 1 other location - About 1 hr to fix
      webpack/ForemanColumnExtensions/index.js on lines 91..101

      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

        {
          columnName: 'content_view',
          title: __('Content view'),
          wrapper: (hostDetails) => {
            const contentView =
      Severity: Major
      Found in webpack/ForemanColumnExtensions/index.js and 1 other location - About 1 hr to fix
      webpack/ForemanColumnExtensions/index.js on lines 80..90

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

                {bugfix !== undefined &&
                  <FlexItem>
                    <BugIcon color="#8bc1f7" />
                    <Link to={hostErrataUrl('bugfix')}>{bugfix}</Link>
                  </FlexItem>
      Severity: Major
      Found in webpack/ForemanColumnExtensions/index.js and 2 other locations - About 1 hr to fix
      webpack/ForemanColumnExtensions/index.js on lines 39..44
      webpack/ForemanColumnExtensions/index.js on lines 51..56

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

      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

                {enhancement !== undefined &&
                  <FlexItem>
                    <EnhancementIcon color="#002f5d" />
                    <Link to={hostErrataUrl('enhancement')}>{enhancement}</Link>
                  </FlexItem>
      Severity: Major
      Found in webpack/ForemanColumnExtensions/index.js and 2 other locations - About 1 hr to fix
      webpack/ForemanColumnExtensions/index.js on lines 39..44
      webpack/ForemanColumnExtensions/index.js on lines 45..50

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

      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

                {security !== undefined &&
                  <FlexItem>
                    <SecurityIcon color="#0066cc" />
                    <Link to={hostErrataUrl('security')}>{security}</Link>
                  </FlexItem>
      Severity: Major
      Found in webpack/ForemanColumnExtensions/index.js and 2 other locations - About 1 hr to fix
      webpack/ForemanColumnExtensions/index.js on lines 45..50
      webpack/ForemanColumnExtensions/index.js on lines 51..56

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

      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

      There are no issues that match your filters.

      Category
      Status