labhackercd/linguagem-simples-front

View on GitHub
src/components/Dashboard/Content/externalContentPanel.js

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%

Function ExternalContentPanel has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function ExternalContentPanel(props) {
  const classes = useStyles();
  const [value, setValue] = React.useState(0);

  const handleChange = (event, newValue) => {
Severity: Major
Found in src/components/Dashboard/Content/externalContentPanel.js - About 2 hrs to fix

    Similar blocks of code found in 5 locations. Consider refactoring.
    Invalid

              <Tab  key={3} id="radioCamaraContentTab" classes={{ root: classes.tab}}
                    label={<TabLabel tabValue={3} tabText={"Rádio Câmara"} tabIcon={<RadioOutlinedIcon/>}/>}/>
    Severity: Major
    Found in src/components/Dashboard/Content/externalContentPanel.js and 4 other locations - About 2 hrs to fix
    src/components/Dashboard/Content/externalContentPanel.js on lines 136..137
    src/components/Dashboard/Content/externalContentPanel.js on lines 138..139
    src/components/Dashboard/Content/externalContentPanel.js on lines 140..141
    src/components/Dashboard/Content/externalContentPanel.js on lines 144..145

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

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

              <Tab  key={0} id="savedContentTab" classes={{ root: classes.tab}}
                    label={<TabLabel tabValue={0} tabText={"Conteúdos Salvos"} tabIcon={<BookmarkBorderIcon/>}/>}/>
    Severity: Major
    Found in src/components/Dashboard/Content/externalContentPanel.js and 4 other locations - About 2 hrs to fix
    src/components/Dashboard/Content/externalContentPanel.js on lines 138..139
    src/components/Dashboard/Content/externalContentPanel.js on lines 140..141
    src/components/Dashboard/Content/externalContentPanel.js on lines 142..143
    src/components/Dashboard/Content/externalContentPanel.js on lines 144..145

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

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

              <Tab  key={2} id="tvCamaraContentTab" classes={{ root: classes.tab}}
                    label={<TabLabel tabValue={2} tabText={"TV Câmara"} tabIcon={<LiveTvOutlinedIcon/>}/>}/>
    Severity: Major
    Found in src/components/Dashboard/Content/externalContentPanel.js and 4 other locations - About 2 hrs to fix
    src/components/Dashboard/Content/externalContentPanel.js on lines 136..137
    src/components/Dashboard/Content/externalContentPanel.js on lines 138..139
    src/components/Dashboard/Content/externalContentPanel.js on lines 142..143
    src/components/Dashboard/Content/externalContentPanel.js on lines 144..145

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

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

              <Tab  key={4} id="twitterContentTab" classes={{ root: classes.tab}}
                    label={<TabLabel tabValue={4} tabText={"Twitter"} tabIcon={<TwitterIcon/>}/>}/>
    Severity: Major
    Found in src/components/Dashboard/Content/externalContentPanel.js and 4 other locations - About 2 hrs to fix
    src/components/Dashboard/Content/externalContentPanel.js on lines 136..137
    src/components/Dashboard/Content/externalContentPanel.js on lines 138..139
    src/components/Dashboard/Content/externalContentPanel.js on lines 140..141
    src/components/Dashboard/Content/externalContentPanel.js on lines 142..143

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

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

              <Tab  key={1} id="agenciaCamaraContentTab" classes={{ root: classes.tab}}
                    label={<TabLabel tabValue={1} tabText={"Agência Câmara"} tabIcon={<DescriptionOutlinedIcon/>}/>}/>
    Severity: Major
    Found in src/components/Dashboard/Content/externalContentPanel.js and 4 other locations - About 2 hrs to fix
    src/components/Dashboard/Content/externalContentPanel.js on lines 136..137
    src/components/Dashboard/Content/externalContentPanel.js on lines 140..141
    src/components/Dashboard/Content/externalContentPanel.js on lines 142..143
    src/components/Dashboard/Content/externalContentPanel.js on lines 144..145

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

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

            <TabPanel value={value} index={2}><TvCamaraContent sessionId={props.sessionId}></TvCamaraContent></TabPanel>
    Severity: Minor
    Found in src/components/Dashboard/Content/externalContentPanel.js and 2 other locations - About 35 mins to fix
    src/components/Dashboard/Content/externalContentPanel.js on lines 156..156
    src/components/Dashboard/Content/externalContentPanel.js on lines 159..159

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

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

            <TabPanel value={value} index={3}><RadioCamaraContent sessionId={props.sessionId}></RadioCamaraContent></TabPanel>
    Severity: Minor
    Found in src/components/Dashboard/Content/externalContentPanel.js and 2 other locations - About 35 mins to fix
    src/components/Dashboard/Content/externalContentPanel.js on lines 156..156
    src/components/Dashboard/Content/externalContentPanel.js on lines 158..158

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

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

            <TabPanel value={value} index={0}><SavedContent sessionId={props.sessionId}></SavedContent></TabPanel>
    Severity: Minor
    Found in src/components/Dashboard/Content/externalContentPanel.js and 2 other locations - About 35 mins to fix
    src/components/Dashboard/Content/externalContentPanel.js on lines 158..158
    src/components/Dashboard/Content/externalContentPanel.js on lines 159..159

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

    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