labhackercd/linguagem-simples-front

View on GitHub
src/components/Dashboard/Content/TVCamara/tvCamaraCard.js

Summary

Maintainability
A
50 mins
Test Coverage
A
93%

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

  render(){
    return (
      <Box width="97%" height="100%" >
        <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/TVCamara/tvCamaraCard.js - About 2 hrs to fix

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

                      <Grid item xs={1}>
                        <CopyToClipboard text={this.state.info.url}>
                          <IconButton size="small">
                            <FileCopyTwoToneIcon text={this.state.info.url} fontSize="inherit" onClick={this.showCopiedSnackBar}/>                                
                          </IconButton>
    Severity: Major
    Found in src/components/Dashboard/Content/TVCamara/tvCamaraCard.js and 1 other location - About 1 day to fix
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 83..101

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

    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

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

    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

    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/TVCamara/tvCamaraCard.js and 2 other locations - About 5 hrs to fix
    src/components/Dashboard/Content/AgenciaCamara/newsCard.js on lines 52..62
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 50..60

    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={2} >
                  <Box width={1} height={1}>
                    <Box display="flex" justifyContent="center" alignItems="center" width={"100%"} height={"100%"}>
                      <img style={{width:"75%", height:"75%"}} src={TVIcon} alt="Ícone de Televisão"></img>
                    </Box>
    Severity: Major
    Found in src/components/Dashboard/Content/TVCamara/tvCamaraCard.js and 1 other location - About 4 hrs to fix
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 72..78

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

    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/TVCamara/tvCamaraCard.js and 3 other locations - About 1 hr to fix
    src/components/Dashboard/Content/AgenciaCamara/newsCard.js on lines 67..67
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 69..69
    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/TVCamara/tvCamaraCard.js and 2 other locations - About 50 mins to fix
    src/components/Dashboard/Content/AgenciaCamara/newsCard.js on lines 37..39
    src/components/Dashboard/Content/RadioCamara/radioCard.js on lines 62..64

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

    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