labhackercd/linguagem-simples-front

View on GitHub

Showing 57 of 206 total issues

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

test('Test with URL doesnt break page', () => {
  const wrapper = mount(<URLInputDialog URLInputDialogOpen={true}
                                        setCustomURL={jest.fn()}
                                        customURL="testURL"
                                        handleDialogStateAction={jest.fn()}/>)
src/components/Dashboard/Timeline/Dialogs/URLInput/index.test.js on lines 19..32

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

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

test('Clicking on buttons doesnt break page', () => {
  const wrapper = mount(<URLInputDialog URLInputDialogOpen={true}
                                        setCustomURL={jest.fn()}
                                        customURL="testURL"
                                        handleDialogStateAction={jest.fn()}/>)
src/components/Dashboard/Timeline/Dialogs/URLInput/index.test.js on lines 34..47

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

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

    typography: {
      fontFamily: "OpenSans",
      body:{
        fontSize:12,
        fontStyle: 'semibold',
Severity: Major
Found in src/components/Dashboard/Timeline/mockTheme.js and 1 other location - About 6 hrs to fix
src/theme.js on lines 18..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 171.

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

    typography: {
      fontFamily: "OpenSans",
      body:{
        fontSize:12,
        fontStyle: 'semibold',
Severity: Major
Found in src/theme.js and 1 other location - About 6 hrs to fix
src/components/Dashboard/Timeline/mockTheme.js on lines 6..48

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

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

Function Feed has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function Feed(props) {
  const classes = useStyles();
    const [anchorEl, setAnchorEl] = useState(null)
    const [updates, setUpdates] = useState('')
    const { handleDeletePost } = props
Severity: Major
Found in src/components/Dashboard/Timeline/Feed/index.js - About 5 hrs to fix

    Function render has 121 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        render(){
        const { classes } = this.props;
        
        if(this.state.sucessfullCreatedSession) {
            return <Redirect to={DASHBOARD_BASE_URL+this.state.idSessionCreatedToRedirect}/>

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

            <Grid container className={classes.summaryHeader}>
              <Grid item md={6} style={{display:'flex', justifyContent: 'flex-start'}}>
                <Typography variant="h5"> Nova atualização </Typography>
              </Grid>
              <Grid item md={6} style={{display:'flex', justifyContent: 'flex-end'}}>
      Severity: Major
      Found in src/components/Dashboard/Timeline/NewUpdate/index.js and 1 other location - About 4 hrs to fix
      src/components/Dashboard/Timeline/SummaryBox/index.js on lines 78..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 126.

      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

            <Grid container className={classes.summaryHeader}>
              <Grid item md={6} style={{display:'flex', justifyContent: 'flex-start'}}>
                <Typography variant="h5"> Resumo </Typography>
              </Grid>
              <Grid item md={6} style={{display:'flex', justifyContent: 'flex-end'}}>
      Severity: Major
      Found in src/components/Dashboard/Timeline/SummaryBox/index.js and 1 other location - About 4 hrs to fix
      src/components/Dashboard/Timeline/NewUpdate/index.js on lines 91..97

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

      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

        test('test summary box button click', () => {
          const summaryBoxWrapper = wrapper.findWhere(node => node.is(SummaryBox));
          const summaryBoxTextField = summaryBoxWrapper.find('#summary-box-textfield').last()
          summaryBoxTextField.instance().value = "summaryBox test";
          summaryBoxTextField.simulate("change");
      Severity: Major
      Found in src/components/Dashboard/Timeline/index.test.js and 1 other location - About 4 hrs to fix
      src/components/Dashboard/Timeline/index.test.js on lines 47..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 124.

      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

        test('simple text input', () => {
          const newUpdateWrapper = wrapper.findWhere(node => node.is(NewUpdate));
          const textField = newUpdateWrapper.find('#newUpdateTextField').last()
          textField.instance().value = "new update test";
          textField.simulate("change");
      Severity: Major
      Found in src/components/Dashboard/Timeline/index.test.js and 1 other location - About 4 hrs to fix
      src/components/Dashboard/Timeline/index.test.js on lines 32..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 124.

      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

        it("doesnt break on end stream button click", () => {
          const wrapper = mount(<MockTheme>
                                  <Header setBroadcastingStatus={jest.fn()}
                                                          broadcastingOnline={true}/>
                                </MockTheme>);
      Severity: Major
      Found in src/components/Dashboard/Timeline/Header/index.test.js and 1 other location - About 4 hrs to fix
      src/components/Dashboard/Timeline/Header/index.test.js on lines 20..28

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

      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

        it("doesnt break on start stream button click", () => {
          const wrapper = mount(<MockTheme>
                                  <Header setBroadcastingStatus={jest.fn()}
                                                          broadcastingOnline={false}/>
                                </MockTheme>);
      Severity: Major
      Found in src/components/Dashboard/Timeline/Header/index.test.js and 1 other location - About 4 hrs to fix
      src/components/Dashboard/Timeline/Header/index.test.js on lines 30..38

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

      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

      Function render has 96 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          render() {
              const { classes } = this.props;
              return (
                  <Dialog
                      fullWidth={true}
      Severity: Major
      Found in src/components/Dashboard/Timeline/Dialogs/Preview/index.js - About 3 hrs to fix

        Function NewUpdate has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function NewUpdate(props) {
          const classes = useStyles();
            const dateAux = props.date ? parseHourMinute(props.date) : parseHourMinute(new Date())
            const [date, setDate] = useState(dateAux)
        
        
        Severity: Major
        Found in src/components/Dashboard/Timeline/NewUpdate/index.js - About 2 hrs to fix

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

                          <div className={classes.subMenuItem}>
                            <a href="/"><img src={PictureUploadIcon} id={"picture-upload-icon"} alt="upload icon" onClick={(e) => props.handleDialogStateAction(e, true, "previewDialog", "InputImage")}/></a>
                          </div>
          Severity: Major
          Found in src/components/Dashboard/Timeline/NewUpdate/index.js and 2 other locations - About 2 hrs to fix
          src/components/Dashboard/Timeline/NewUpdate/index.js on lines 133..135
          src/components/Dashboard/Timeline/NewUpdate/index.js on lines 136..138

          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

                                          <div className={classes.subMenuItem}>
                                              <a href="/"><img src={TwitterIcon} id={"tweet-insert-icon"}alt="incorporate twitter icon" onClick={(e) => props.handleDialogStateAction(e, true, "URLInputDialog", "URLInputIsTwitter")}/></a>
                                          </div>
          Severity: Major
          Found in src/components/Dashboard/Timeline/NewUpdate/index.js and 2 other locations - About 2 hrs to fix
          src/components/Dashboard/Timeline/NewUpdate/index.js on lines 130..132
          src/components/Dashboard/Timeline/NewUpdate/index.js on lines 136..138

          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

                                          <div className={classes.subMenuItem}>
                                              <a href="/"><img src={LinkIcon} id={"link-insert-icon"} alt="incorporate url icon" onClick={(e) => props.handleDialogStateAction(e, true, "URLInputDialog", "noAction")}/></a>
                                          </div>
          Severity: Major
          Found in src/components/Dashboard/Timeline/NewUpdate/index.js and 2 other locations - About 2 hrs to fix
          src/components/Dashboard/Timeline/NewUpdate/index.js on lines 130..132
          src/components/Dashboard/Timeline/NewUpdate/index.js on lines 133..135

          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

          Function render has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render(){
                  const { classes } = this.props;
          
                  if(!this.state.dataLoaded){
                      return (<Box display="flex" justifyContent="center" alignItems="center">

            Function EndBroadcastAlert has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function EndBroadcastAlert(props) {
              const classes = useStyles();
                const { onClose, value: valueProp, action, open } = props;
                const [value, setValue] = React.useState(valueProp);
            
            
            Severity: Major
            Found in src/components/Dashboard/Timeline/Dialogs/Alert/EndBroadcast/index.js - About 2 hrs to fix

              Function SummaryBox has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function SummaryBox(props) {
                const classes = useStyles();
                const sessionID = props.sessionID;
                const [textFieldValue, setTextFieldValue] = useState('');
                function handleChange(e) {
              Severity: Major
              Found in src/components/Dashboard/Timeline/SummaryBox/index.js - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language