myems-web/src/components/bootstrap-components/Buttons.js

Summary

Maintainability
F
4 days
Test Coverage

File Buttons.js has 452 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Fragment } from 'react';
import { Button, Card, CardHeader, CardBody } from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import PageHeader from '../common/PageHeader';
import FalconCardHeader from '../common/FalconCardHeader';
Severity: Minor
Found in myems-web/src/components/bootstrap-components/Buttons.js - About 6 hrs to fix

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

        <Card className="mb-3">
          <CardHeader>
            <h5>Button toolbar with input group</h5>
            <p className="mb-0">
              Feel free to mix input groups with button groups in your toolbars. Similar to the example above, you'll likely
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 6 other locations - About 2 hrs to fix
    myems-web/src/components/bootstrap-components/Buttons.js on lines 415..426
    myems-web/src/components/bootstrap-components/Buttons.js on lines 439..450
    myems-web/src/components/bootstrap-components/Buttons.js on lines 451..462
    myems-web/src/components/utilities/Typography.js on lines 156..169
    myems-web/src/components/utilities/Typography.js on lines 187..195
    myems-web/src/components/utilities/Typography.js on lines 196..204

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

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

        <Card className="mb-3">
          <CardHeader>
            <h5>Button Toolbar</h5>
            <p className="mb-0">
              Combine sets of button groups into button toolbars for more complex components. Use utility classes as needed
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 6 other locations - About 2 hrs to fix
    myems-web/src/components/bootstrap-components/Buttons.js on lines 427..438
    myems-web/src/components/bootstrap-components/Buttons.js on lines 439..450
    myems-web/src/components/bootstrap-components/Buttons.js on lines 451..462
    myems-web/src/components/utilities/Typography.js on lines 156..169
    myems-web/src/components/utilities/Typography.js on lines 187..195
    myems-web/src/components/utilities/Typography.js on lines 196..204

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

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

        <Card className="mb-3">
          <CardHeader>
            <h5>Sizing</h5>
            <p className="mb-0">
              Insteam of aplying button sizing classes to every button in a group, just add .btn-gorup-* to each .btn-group,
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 6 other locations - About 2 hrs to fix
    myems-web/src/components/bootstrap-components/Buttons.js on lines 415..426
    myems-web/src/components/bootstrap-components/Buttons.js on lines 427..438
    myems-web/src/components/bootstrap-components/Buttons.js on lines 451..462
    myems-web/src/components/utilities/Typography.js on lines 156..169
    myems-web/src/components/utilities/Typography.js on lines 187..195
    myems-web/src/components/utilities/Typography.js on lines 196..204

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

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

        <Card className="mb-3">
          <CardHeader>
            <h5>Vertical variation</h5>
            <p className="mb-0">
              Make a set of buttons appear vertically tacked rather than horizontally. Split button dropdowns ae not
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 6 other locations - About 2 hrs to fix
    myems-web/src/components/bootstrap-components/Buttons.js on lines 415..426
    myems-web/src/components/bootstrap-components/Buttons.js on lines 427..438
    myems-web/src/components/bootstrap-components/Buttons.js on lines 439..450
    myems-web/src/components/utilities/Typography.js on lines 156..169
    myems-web/src/components/utilities/Typography.js on lines 187..195
    myems-web/src/components/utilities/Typography.js on lines 196..204

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

    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

        <Card className="mb-3">
          <FalconCardHeader title="Button Capsule" light={false} />
          <CardBody className="bg-light">
            <FalconEditor code={capsuleButtonCode} scope={{ FontAwesomeIcon, ButtonIcon }} />
          </CardBody>
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 2 other locations - About 2 hrs to fix
    myems-web/src/components/bootstrap-components/Avatar.js on lines 147..152
    myems-web/src/components/bootstrap-components/Buttons.js on lines 356..361

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

    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

        <Card className="mb-3">
          <FalconCardHeader title="Icon Buttons" light={false} />
          <CardBody className="bg-light">
            <FalconEditor code={IconButtonCode} scope={{ FontAwesomeIcon, ButtonIcon }} />
          </CardBody>
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 2 other locations - About 2 hrs to fix
    myems-web/src/components/bootstrap-components/Avatar.js on lines 147..152
    myems-web/src/components/bootstrap-components/Buttons.js on lines 380..385

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

    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

        <Card>
          <FalconCardHeader title=" Checkbox (Stateful Buttons)" light={false} />
          <CardBody className="bg-light">
            <FalconEditor code={multiSelectCheckboxExample} language="jsx" />
          </CardBody>
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 2 other locations - About 1 hr to fix
    myems-web/src/components/bootstrap-components/Alerts.js on lines 101..106
    myems-web/src/components/bootstrap-components/Badges.js on lines 57..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 70.

    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

        <Card className="mb-3">
          <FalconCardHeader title="Examples" light={false} />
          <CardBody>
            <FalconEditor code={buttonCode} language="jsx" />
          </CardBody>
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 1 other location - About 1 hr to fix
    myems-web/src/components/bootstrap-components/Buttons.js on lines 325..330

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

    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

        <Card className="mb-3">
          <FalconCardHeader title="Falcon Buttons" light={false} />
          <CardBody>
            <FalconEditor code={buttonFalconCode} language="jsx" />
          </CardBody>
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 1 other location - About 1 hr to fix
    myems-web/src/components/bootstrap-components/Buttons.js on lines 338..343

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

    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

          <CardHeader>
            <h5>Basic Example</h5>
            <p className="mb-0">
              Wrap a series of buttons with<code>.btn</code> in<code>.btn-group</code>. Add on optional JavaScript radio and
              checkbox style behavior with
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 1 other location - About 1 hr to fix
    myems-web/src/components/utilities/Typography.js on lines 171..176

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

    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

        <Card className="mb-3">
          <FalconCardHeader title="Button sizes" light={false} />
          <CardBody>
            <FalconEditor code={buttonSizeCode} />
          </CardBody>
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 1 other location - About 1 hr to fix
    myems-web/src/components/bootstrap-components/Buttons.js on lines 344..349

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 65.

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

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

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

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

    Refactorings

    Further Reading

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

        <Card className="mb-3">
          <FalconCardHeader title="Outline buttons" light={false} />
          <CardBody>
            <FalconEditor code={buttonOutlineCode} />
          </CardBody>
    Severity: Major
    Found in myems-web/src/components/bootstrap-components/Buttons.js and 1 other location - About 1 hr to fix
    myems-web/src/components/bootstrap-components/Buttons.js on lines 350..355

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 65.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status