RedHatInsights/insights-rbac-ui

View on GitHub

Showing 381 of 381 total issues

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

export const updateGroup = (groupData) => {
  const cache = createIntlCache();
  const intl = createIntl({ locale, messages: providerMessages }, cache);
  return {
    type: ActionTypes.UPDATE_GROUP,
Severity: Major
Found in src/redux/actions/group-actions.js and 2 other locations - About 1 day to fix
src/redux/actions/user-actions.js on lines 39..64
src/redux/actions/user-actions.js on lines 66..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 197.

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 User has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
Open

const User = () => {
  const intl = useIntl();
  const navigate = useAppNavigate();
  const navigationType = useNavigationType();
  const dispatch = useDispatch();
Severity: Minor
Found in src/smart-components/user/user.js - About 7 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

export const removeMembersFromGroup = (groupId, members) => {
  const cache = createIntlCache();
  const intl = createIntl({ locale, messages: providerMessages }, cache);
  return {
    type: ActionTypes.REMOVE_MEMBERS_FROM_GROUP,
Severity: Major
Found in src/redux/actions/group-actions.js and 3 other locations - About 7 hrs to fix
src/redux/actions/group-actions.js on lines 263..286
src/redux/actions/group-actions.js on lines 288..311
src/redux/actions/policy-actions.js on lines 62..85

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

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

export const removeRolesFromGroup = (groupId, roles) => {
  const cache = createIntlCache();
  const intl = createIntl({ locale, messages: providerMessages }, cache);
  return {
    type: ActionTypes.REMOVE_ROLES_FROM_GROUP,
Severity: Major
Found in src/redux/actions/group-actions.js and 3 other locations - About 7 hrs to fix
src/redux/actions/group-actions.js on lines 153..176
src/redux/actions/group-actions.js on lines 263..286
src/redux/actions/policy-actions.js on lines 62..85

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

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

export const addRolesToGroup = (groupId, roles) => {
  const cache = createIntlCache();
  const intl = createIntl({ locale, messages: providerMessages }, cache);
  return {
    type: ActionTypes.ADD_ROLES_TO_GROUP,
Severity: Major
Found in src/redux/actions/group-actions.js and 3 other locations - About 7 hrs to fix
src/redux/actions/group-actions.js on lines 153..176
src/redux/actions/group-actions.js on lines 288..311
src/redux/actions/policy-actions.js on lines 62..85

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

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

export const updatePolicy = (uuid, policyData) => {
  const cache = createIntlCache();
  const intl = createIntl({ locale, messages: providerMessages }, cache);
  return {
    type: ActionTypes.UPDATE_POLICY,
Severity: Major
Found in src/redux/actions/policy-actions.js and 3 other locations - About 7 hrs to fix
src/redux/actions/group-actions.js on lines 153..176
src/redux/actions/group-actions.js on lines 263..286
src/redux/actions/group-actions.js on lines 288..311

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

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 createPolicy = (policyData) => {
  const cache = createIntlCache();
  const intl = createIntl({ locale, messages: providerMessages }, cache);
  return {
    type: ActionTypes.ADD_POLICY,
Severity: Major
Found in src/redux/actions/policy-actions.js and 1 other location - About 7 hrs to fix
src/redux/actions/role-actions.js on lines 57..80

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

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 removeRole = (role) => {
  const cache = createIntlCache();
  const intl = createIntl({ locale, messages: providerMessages }, cache);
  return {
    type: ActionTypes.REMOVE_ROLE,
Severity: Major
Found in src/redux/actions/role-actions.js and 1 other location - About 7 hrs to fix
src/redux/actions/policy-actions.js on lines 18..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 187.

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="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

Function GroupMembers has 179 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const GroupMembers = () => {
  const intl = useIntl();
  const chrome = useChrome();
  const [filterValue, setFilterValue] = useState('');
  const [selectedMembers, setSelectedMembers] = useState([]);
Severity: Major
Found in src/smart-components/group/member/group-members.js - About 7 hrs to fix

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

      const columns = [
        { title: intl.formatMessage(displayNarrow ? messages.orgAdmin : messages.orgAdministrator), key: 'org-admin', transforms: [nowrap] },
        { title: intl.formatMessage(messages.username), key: 'username', transforms: [sortable] },
        { title: intl.formatMessage(messages.email) },
        { title: intl.formatMessage(messages.firstName), transforms: [nowrap] },
    Severity: Major
    Found in src/smart-components/group/add-group/users-list.js and 1 other location - About 7 hrs to fix
    src/smart-components/group/add-group/users-list-itless.js on lines 331..338

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

    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

      const columns = [
        { title: intl.formatMessage(displayNarrow ? messages.orgAdmin : messages.orgAdministrator), key: 'org-admin', transforms: [nowrap] },
        { title: intl.formatMessage(messages.username), key: 'username', transforms: [sortable] },
        { title: intl.formatMessage(messages.email) },
        { title: intl.formatMessage(messages.firstName), transforms: [nowrap] },
    Severity: Major
    Found in src/smart-components/group/add-group/users-list-itless.js and 1 other location - About 7 hrs to fix
    src/smart-components/group/add-group/users-list.js on lines 55..62

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

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

    const GroupServiceAccounts = () => {
      const intl = useIntl();
      const dispatch = useDispatch();
      const navigate = useAppNavigate();
      const { groupId } = useParams();
    Severity: Major
    Found in src/smart-components/group/service-account/group-service-accounts.js - About 6 hrs to fix

      Function createRows has 170 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const createRows = (isAdmin, data, selectedRows, expanded = []) => {
        const intl = useIntl();
      
        const compoundRolesCells = [
          { title: intl.formatMessage(messages.roleName) },
      Severity: Major
      Found in src/smart-components/group/group-table-helpers.js - About 6 hrs to fix

        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

        Severity
        Category
        Status
        Source
        Language