myems-web/src/components/Settings/SettingsAccount.js

Summary

Maintainability
F
3 days
Test Coverage

Function SettingsAccount has 123 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SettingsAccount = () => {
  // State
  const [viewProfile, setViewProfile] = useState('view-everyone');
  const [tagSetting, setTagSetting] = useState('tag-off');
  const [showFollowers, setShowFollowers] = useState(true);
Severity: Major
Found in myems-web/src/components/Settings/SettingsAccount.js - About 4 hrs to fix

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

            <div className="pl-2">
              <CustomInput
                name="tag-setting"
                id="tag-everyone"
                label="Everyone"
    Severity: Major
    Found in myems-web/src/components/Settings/SettingsAccount.js and 1 other location - About 1 day to fix
    myems-web/src/components/Settings/SettingsAccount.js on lines 27..55

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

    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

            <div className="pl-2">
              <CustomInput
                name="view-setting"
                id="view-everyone"
                label="Everyone"
    Severity: Major
    Found in myems-web/src/components/Settings/SettingsAccount.js and 1 other location - About 1 day to fix
    myems-web/src/components/Settings/SettingsAccount.js on lines 63..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 224.

    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

            <h6 className="mt-2 font-weight-bold">
              Who can tag you ?
              <FontAwesomeIcon icon="question-circle" className="fs--2 ml-1 text-primary" id="tag-setting-tooltip" />
              <UncontrolledTooltip placement="top" target="tag-setting-tooltip">
                Only the group of selected people can tag you
    Severity: Major
    Found in myems-web/src/components/Settings/SettingsAccount.js and 1 other location - About 1 hr to fix
    myems-web/src/components/Settings/SettingsAccount.js on lines 20..26

    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

            <h6 className="font-weight-bold">
              Who can see your profile ?
              <FontAwesomeIcon icon="question-circle" className="fs--2 ml-1 text-primary" id="view-setting-tooltip" />
              <UncontrolledTooltip placement="top" target="view-setting-tooltip">
                Only the group of selected people can see your profile
    Severity: Major
    Found in myems-web/src/components/Settings/SettingsAccount.js and 1 other location - About 1 hr to fix
    myems-web/src/components/Settings/SettingsAccount.js on lines 56..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 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 5 locations. Consider refactoring.
    Open

            <CustomInput
              id="show-phone-number"
              label="Make your phone number visible"
              onChange={() => setShowPhoneNumber(!showPhoneNumber)}
              checked={showPhoneNumber}
    Severity: Major
    Found in myems-web/src/components/Settings/SettingsAccount.js and 4 other locations - About 30 mins to fix
    myems-web/src/components/Settings/SettingsAccount.js on lines 93..99
    myems-web/src/components/Settings/SettingsAccount.js on lines 100..106
    myems-web/src/components/Settings/SettingsAccount.js on lines 107..113
    myems-web/src/components/Settings/SettingsAccount.js on lines 122..128

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

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

            <CustomInput
              id="allow-follow"
              label="Allow user to follow you"
              onChange={() => setAllowFollow(!allowFollow)}
              checked={allowFollow}
    Severity: Major
    Found in myems-web/src/components/Settings/SettingsAccount.js and 4 other locations - About 30 mins to fix
    myems-web/src/components/Settings/SettingsAccount.js on lines 93..99
    myems-web/src/components/Settings/SettingsAccount.js on lines 100..106
    myems-web/src/components/Settings/SettingsAccount.js on lines 107..113
    myems-web/src/components/Settings/SettingsAccount.js on lines 115..121

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

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

            <CustomInput
              id="show-experiences"
              label="Allow users to show your experiences"
              onChange={() => setShowExperiences(!showExperiences)}
              checked={showExperiences}
    Severity: Major
    Found in myems-web/src/components/Settings/SettingsAccount.js and 4 other locations - About 30 mins to fix
    myems-web/src/components/Settings/SettingsAccount.js on lines 93..99
    myems-web/src/components/Settings/SettingsAccount.js on lines 100..106
    myems-web/src/components/Settings/SettingsAccount.js on lines 115..121
    myems-web/src/components/Settings/SettingsAccount.js on lines 122..128

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

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

            <CustomInput
              id="show-followers"
              label="Allow users to show your followers"
              onChange={() => setShowFollowers(!showFollowers)}
              checked={showFollowers}
    Severity: Major
    Found in myems-web/src/components/Settings/SettingsAccount.js and 4 other locations - About 30 mins to fix
    myems-web/src/components/Settings/SettingsAccount.js on lines 100..106
    myems-web/src/components/Settings/SettingsAccount.js on lines 107..113
    myems-web/src/components/Settings/SettingsAccount.js on lines 115..121
    myems-web/src/components/Settings/SettingsAccount.js on lines 122..128

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

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

            <CustomInput
              id="show-email"
              label="Allow users to show your email"
              onChange={() => setShowEmail(!showEmail)}
              checked={showEmail}
    Severity: Major
    Found in myems-web/src/components/Settings/SettingsAccount.js and 4 other locations - About 30 mins to fix
    myems-web/src/components/Settings/SettingsAccount.js on lines 93..99
    myems-web/src/components/Settings/SettingsAccount.js on lines 107..113
    myems-web/src/components/Settings/SettingsAccount.js on lines 115..121
    myems-web/src/components/Settings/SettingsAccount.js on lines 122..128

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

    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