labhackercd/linguagem-simples-front

View on GitHub

Showing 57 of 206 total issues

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

  button: {
    height: 'inherit',
    alignSelf: 'center',
        borderRadius: '0 0 5px 5px',
        backgroundColor: theme.palette.verdeCamaraLight.main,
Severity: Major
Found in src/components/Dashboard/Timeline/NewUpdate/index.js and 1 other location - About 1 hr to fix
src/components/Dashboard/Timeline/SummaryBox/index.js on lines 30..37

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

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

    button: {
      height: 'inherit',
      alignSelf: 'center',
        borderRadius: '0 0 5px 5px',
        backgroundColor: theme.palette.verdeCamaraLight.main,
Severity: Major
Found in src/components/Dashboard/Timeline/SummaryBox/index.js and 1 other location - About 1 hr to fix
src/components/Dashboard/Timeline/NewUpdate/index.js on lines 42..49

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

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 URLInputDialog has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export default function URLInputDialog(props) {
    const [validURL, setValidURL] = useState(false)
    const [urlInput, setURLInput] = useState('')
    const [standardProtocol] = useState('https://')

Severity: Minor
Found in src/components/Dashboard/Timeline/Dialogs/URLInput/index.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function registerValidSW has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function registerValidSW(swUrl, config) {
  navigator.serviceWorker
    .register(swUrl)
    .then(registration => {
      registration.onupdatefound = () => {
Severity: Minor
Found in src/serviceWorker.js - About 1 hr to fix

    Function StatusSelection has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function StatusSelection(props) {
      const classes = useStyles();
      const [titlesArray] = useState([
                                      'Pré-sessão',
                                      'Sessão Iniciada',
    Severity: Minor
    Found in src/components/Dashboard/Timeline/StatusSelection/index.js - About 1 hr to fix

      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/RadioCamara/radioCard.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/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

      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

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

          test("Test if submitSummaryContent returns error if no publication id is passed", async (done) => {
              data = await  submitSummaryContent();
              expect(data).toBe("Please provide a valid publication id");
              done()
          });
      Severity: Minor
      Found in src/components/Dashboard/Timeline/timelineAPIhandler.test.js and 2 other locations - About 35 mins to fix
      src/components/Dashboard/Timeline/timelineAPIhandler.test.js on lines 72..76
      src/components/Dashboard/Timeline/timelineAPIhandler.test.js on lines 108..112

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

          test("Test if deletePostFromFeed returns error if no publication id is passed", async (done) => {
              data = await deletePostFromFeed( );
              expect(data).toBe("Please provide a valid publication id");
              done()
          });
      Severity: Minor
      Found in src/components/Dashboard/Timeline/timelineAPIhandler.test.js and 2 other locations - About 35 mins to fix
      src/components/Dashboard/Timeline/timelineAPIhandler.test.js on lines 72..76
      src/components/Dashboard/Timeline/timelineAPIhandler.test.js on lines 132..136

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

          test("Test if fetchFeedUpdates returns error if no publication id is passed", async (done) => {
              data = await fetchFeedUpdates( );
              expect(data).toBe("Please provide a valid session Id");
              done()
          });
      Severity: Minor
      Found in src/components/Dashboard/Timeline/timelineAPIhandler.test.js and 2 other locations - About 35 mins to fix
      src/components/Dashboard/Timeline/timelineAPIhandler.test.js on lines 108..112
      src/components/Dashboard/Timeline/timelineAPIhandler.test.js on lines 132..136

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

        tab: {
          whiteSpace: 'nowrap',
          padding: '0 0.5rem',
          margin: '0 0.3rem',
          backgroundColor: '#F2F2F2',
      Severity: Minor
      Found in src/components/Dashboard/Timeline/StatusSelection/index.js and 1 other location - About 35 mins to fix
      src/components/Dashboard/Timeline/Dialogs/Preview/index.js on lines 26..35

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

      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

              sessionTitleAlert: {
              backgroundColor: '#00AF82',
              width: '100%',
              borderRadius: '5px',
              color: 'white',
      Severity: Minor
      Found in src/components/Dashboard/Timeline/Dialogs/Preview/index.js and 1 other location - About 35 mins to fix
      src/components/Dashboard/Timeline/StatusSelection/index.js on lines 22..31

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

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

          OkButton: {
              backgroundColor: theme.palette.verdeCamaraLight.main,
              color: theme.palette.white.main,
              padding: '0.1rem 0.5rem'
          },
      src/components/Dashboard/Timeline/Dialogs/Alert/EndBroadcast/index.js on lines 12..16
      src/components/Dashboard/Timeline/Dialogs/Alert/StartBroadcast/index.js on lines 12..16
      src/components/Dashboard/Timeline/Dialogs/Alert/StartBroadcast/index.js on lines 27..31

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

        dialogContextTest: {
          fontSize: theme.typography.h4.fontSize,
              fontStyle: theme.typography.h4.fontStyle,
              color: '#000',
        },
      src/components/Dashboard/Timeline/Dialogs/Alert/EndBroadcast/index.js on lines 12..16
      src/components/Dashboard/Timeline/Dialogs/Alert/EndBroadcast/index.js on lines 26..30
      src/components/Dashboard/Timeline/Dialogs/Alert/StartBroadcast/index.js on lines 27..31

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

        dialogContextTest: {
          fontSize: theme.typography.h4.fontSize,
              fontStyle: theme.typography.h4.fontStyle,
              color: '#000',
        },
      src/components/Dashboard/Timeline/Dialogs/Alert/EndBroadcast/index.js on lines 26..30
      src/components/Dashboard/Timeline/Dialogs/Alert/StartBroadcast/index.js on lines 12..16
      src/components/Dashboard/Timeline/Dialogs/Alert/StartBroadcast/index.js on lines 27..31

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

          OkButton: {
              backgroundColor: theme.palette.verdeCamaraLight.main,
              color: theme.palette.white.main,
              padding: '0.1rem 0.5rem'
          }
      src/components/Dashboard/Timeline/Dialogs/Alert/EndBroadcast/index.js on lines 12..16
      src/components/Dashboard/Timeline/Dialogs/Alert/EndBroadcast/index.js on lines 26..30
      src/components/Dashboard/Timeline/Dialogs/Alert/StartBroadcast/index.js on lines 12..16

      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

      Severity
      Category
      Status
      Source
      Language