RedHatInsights/insights-rbac-ui

View on GitHub
src/smart-components/overview/overview.js

Summary

Maintainability
F
1 wk
Test Coverage

Function Overview has 225 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Overview = () => {
  const intl = useIntl();
  const [expanded, setExpanded] = useState(true);
  const isWorkspacesFlag = useFlag('platform.rbac.workspaces');
  const isWorkspacesEligible = useFlag('platform.rbac.workspaces-eligible');
Severity: Major
Found in src/smart-components/overview/overview.js - About 1 day to fix

    File overview.js has 266 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { useState } from 'react';
    import {
      ActionList,
      ActionListItem,
      Button,
    Severity: Minor
    Found in src/smart-components/overview/overview.js - About 2 hrs to fix

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

                  <Tr key="row5">
                    <Td dataLabel="Recommended content label">{intl.formatMessage(messages.recommendedContentItem5)}</Td>
                    <Td dataLabel="Recommended content category">
                      <Label color="orange">{intl.formatMessage(messages.labelDocumentation)}</Label>
                    </Td>
      Severity: Major
      Found in src/smart-components/overview/overview.js and 2 other locations - About 7 hrs to fix
      src/smart-components/overview/overview.js on lines 229..239
      src/smart-components/overview/overview.js on lines 240..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 179.

      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

                  <Tr key="row7">
                    <Td dataLabel="Recommended content label">{intl.formatMessage(messages.recommendedContentItem7)}</Td>
                    <Td dataLabel="Recommended content category">
                      <Label color="purple">{intl.formatMessage(messages.labelOtherResource)}</Label>
                    </Td>
      Severity: Major
      Found in src/smart-components/overview/overview.js and 2 other locations - About 7 hrs to fix
      src/smart-components/overview/overview.js on lines 213..228
      src/smart-components/overview/overview.js on lines 229..239

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

      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

                  <Tr key="row6">
                    <Td dataLabel="Recommended content label">{intl.formatMessage(messages.recommendedContentItem6)}</Td>
                    <Td dataLabel="Recommended content category">
                      <Label color="purple">{intl.formatMessage(messages.labelOtherResource)}</Label>
                    </Td>
      Severity: Major
      Found in src/smart-components/overview/overview.js and 2 other locations - About 7 hrs to fix
      src/smart-components/overview/overview.js on lines 213..228
      src/smart-components/overview/overview.js on lines 240..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 179.

      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

                  <Tr key="row3">
                    <Td dataLabel="Recommended content label">{intl.formatMessage(messages.recommendedContentItem3)}</Td>
                    <Td dataLabel="Recommended content category">
                      <Label color="green">{intl.formatMessage(messages.labelQuickStart)}</Label>
                    </Td>
      Severity: Major
      Found in src/smart-components/overview/overview.js and 3 other locations - About 6 hrs to fix
      src/smart-components/overview/overview.js on lines 157..170
      src/smart-components/overview/overview.js on lines 171..184
      src/smart-components/overview/overview.js on lines 199..212

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

      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

                  <Tr key="row1">
                    <Td dataLabel="Recommended content label">{intl.formatMessage(messages.recommendedContentItem1)}</Td>
                    <Td dataLabel="Recommended content category">
                      <Label color="green">{intl.formatMessage(messages.labelQuickStart)}</Label>
                    </Td>
      Severity: Major
      Found in src/smart-components/overview/overview.js and 3 other locations - About 6 hrs to fix
      src/smart-components/overview/overview.js on lines 171..184
      src/smart-components/overview/overview.js on lines 185..198
      src/smart-components/overview/overview.js on lines 199..212

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

      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

                  <Tr key="row2">
                    <Td dataLabel="Recommended content label">{intl.formatMessage(messages.recommendedContentItem2)}</Td>
                    <Td dataLabel="Recommended content category">
                      <Label color="green">{intl.formatMessage(messages.labelQuickStart)}</Label>
                    </Td>
      Severity: Major
      Found in src/smart-components/overview/overview.js and 3 other locations - About 6 hrs to fix
      src/smart-components/overview/overview.js on lines 157..170
      src/smart-components/overview/overview.js on lines 185..198
      src/smart-components/overview/overview.js on lines 199..212

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

      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

                  <Tr key="row4">
                    <Td dataLabel="Recommended content label">{intl.formatMessage(messages.recommendedContentItem4)}</Td>
                    <Td dataLabel="Recommended content category">
                      <Label color="green">{intl.formatMessage(messages.labelQuickStart)}</Label>
                    </Td>
      Severity: Major
      Found in src/smart-components/overview/overview.js and 3 other locations - About 6 hrs to fix
      src/smart-components/overview/overview.js on lines 157..170
      src/smart-components/overview/overview.js on lines 171..184
      src/smart-components/overview/overview.js on lines 185..198

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

      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

                        <ActionListItem>
                          <AppLink to={pathnames.roles.link}>
                            <Button variant="secondary" aria-label="View roles" size="lg" ouiaId="getstarted-view-roles-button">
                              {intl.formatMessage(messages.viewRolesBtn)}
                            </Button>
      Severity: Major
      Found in src/smart-components/overview/overview.js and 1 other location - About 2 hrs to fix
      src/smart-components/overview/overview.js on lines 78..84

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

      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

                        <ActionListItem>
                          <AppLink to={pathnames.groups.link}>
                            <Button variant="primary" size="lg" aria-label="View groups" ouiaId="getstarted-view-groups-button">
                              {intl.formatMessage(messages.viewGroupsBtn)}
                            </Button>
      Severity: Major
      Found in src/smart-components/overview/overview.js and 1 other location - About 2 hrs to fix
      src/smart-components/overview/overview.js on lines 85..91

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

      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