labhackercd/linguagem-simples-front

View on GitHub
src/components/Dashboard/Content/AgenciaCamara/newsCard.js

Summary

Maintainability
A
50 mins
Test Coverage
A
100%

Function render has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Invalid

    render(){
      return (
        <Box width="97%">
            <CustomizedSnackbars open={this.state.snackbar.open} message={this.state.snackbar.message} type={this.state.snackbar.type}></CustomizedSnackbars>
            <Paper elevation={0} style={{background:'#F4F4F4'}}>
Severity: Major
Found in src/components/Dashboard/Content/AgenciaCamara/newsCard.js - About 2 hrs to fix

    Identical blocks of code found in 3 locations. Consider refactoring.
    Invalid

        constructor(props){
          super(props);
          this.state = {
              info : {
                id:this.props.info.id,
    Severity: Major
    Found in src/components/Dashboard/Content/AgenciaCamara/newsCard.js and 2 other locations - About 1 day to fix
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 18..36
    src/components/Dashboard/Content/TVCamara/tvCamaraCard.js on lines 21..39

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

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

                                    <Grid item xs={12}>
                                      <Box fontWeight="fontWeightRegular">
                                      <a rel={'external noopener noreferrer'} target="_blank" href={"https://"+this.state.info.url} style={{textDecoration: "none"}}>
                                          <Typography variant="h6" style={{ color: "#007E5A" }}>
                                              {this.state.info.titulo}
    Severity: Major
    Found in src/components/Dashboard/Content/AgenciaCamara/newsCard.js and 1 other location - About 5 hrs to fix
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 102..110

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

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

        async handleDeleteContent(){
    
            const hasBeenDeleted = await deleteSavedContent(this.state.info.id);
    
            if(hasBeenDeleted){
    Severity: Major
    Found in src/components/Dashboard/Content/AgenciaCamara/newsCard.js and 2 other locations - About 5 hrs to fix
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 50..60
    src/components/Dashboard/Content/TVCamara/tvCamaraCard.js on lines 56..66

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

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

                                    <Grid item xs={12}>
                                      <Box fontSize={11}>
                                        <Typography style={{ color: "gray" }}>
                                             {moment(new Date(this.state.info.data)).format("DD/MM/YYYY HH:mm")}
                                        </Typography>
    Severity: Major
    Found in src/components/Dashboard/Content/AgenciaCamara/newsCard.js and 1 other location - About 3 hrs to fix
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 111..117

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

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

                <CustomizedSnackbars open={this.state.snackbar.open} message={this.state.snackbar.message} type={this.state.snackbar.type}></CustomizedSnackbars>
    Severity: Major
    Found in src/components/Dashboard/Content/AgenciaCamara/newsCard.js and 3 other locations - About 1 hr to fix
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 69..69
    src/components/Dashboard/Content/TVCamara/tvCamaraCard.js on lines 71..71
    src/components/Dashboard/Content/index.js on lines 122..122

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

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

        showCopiedSnackBar = () => {
          this.setState({openSnackBar:true, snackbar:{open: true, message: uiMessages.clipboardCopySucess, type:"success"}})
        }
    Severity: Major
    Found in src/components/Dashboard/Content/AgenciaCamara/newsCard.js and 2 other locations - About 50 mins to fix
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 62..64
    src/components/Dashboard/Content/TVCamara/tvCamaraCard.js on lines 52..54

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

    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

                                    <Grid item xs={10}><Typography style={{ color: "gray" }} variant="body1">Notícia</Typography></Grid>
    Severity: Major
    Found in src/components/Dashboard/Content/AgenciaCamara/newsCard.js and 2 other locations - About 50 mins to fix
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 82..82
    src/components/Dashboard/Content/TVCamara/tvCamaraCard.js on lines 84..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 51.

    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