yassinedoghri/marvel-jarvig

View on GitHub

Showing 44 of 44 total issues

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

  render() {
    const {
      game,
      passQuestion,
      checkAnswer,
Severity: Major
Found in src/containers/PlayScreen/QuestionCard.js - About 4 hrs to fix

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

                <Settings.Item>
                  <Settings.Label>Number of Questions</Settings.Label>
                  <Settings.Counter>
                    {jarvigSettings.numberOfQuestions}
                  </Settings.Counter>
    Severity: Major
    Found in src/containers/SidebarSettings.js and 2 other locations - About 4 hrs to fix
    src/containers/SidebarSettings.js on lines 59..70
    src/containers/SidebarSettings.js on lines 83..96

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

    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

                <Settings.Item>
                  <Settings.Label>Number of Lives</Settings.Label>
                  <Settings.Counter>
                    {jarvigSettings.numberOfLives}
                  </Settings.Counter>
    Severity: Major
    Found in src/containers/SidebarSettings.js and 2 other locations - About 4 hrs to fix
    src/containers/SidebarSettings.js on lines 71..82
    src/containers/SidebarSettings.js on lines 83..96

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

    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

                <Settings.Item>
                  <Settings.Label>Characters per question</Settings.Label>
                  <Settings.Counter>
                    {jarvigSettings.charactersPerQuestion}
                  </Settings.Counter>
    Severity: Major
    Found in src/containers/SidebarSettings.js and 2 other locations - About 4 hrs to fix
    src/containers/SidebarSettings.js on lines 59..70
    src/containers/SidebarSettings.js on lines 71..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 119.

    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 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const {
          isSettingsOpen,
          toggleSidebar,
          jarvigSettings,
    Severity: Major
    Found in src/containers/SidebarSettings.js - About 3 hrs to fix

      Function render has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

        render() {
          const {
            game,
            passQuestion,
            checkAnswer,
      Severity: Minor
      Found in src/containers/PlayScreen/QuestionCard.js - About 3 hrs 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 render has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const { numberOfQuestions, gameResult, difficulty } = this.props;
      
          const resultCounts = getArrayCounts(gameResult);
      
      
      Severity: Major
      Found in src/containers/ResultScreen/index.js - About 2 hrs to fix

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

          render() {
            const { game, selectCharacter } = this.props;
        
            let gridItems = "";
            if (game.choices) {
        Severity: Major
        Found in src/containers/PlayScreen/CharactersGrid.js - About 2 hrs to fix

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

            render() {
              const {
                game,
                isGameLoading,
                passQuestion,
          Severity: Minor
          Found in src/containers/PlayScreen/index.js - About 1 hr to fix

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

              render() {
                const { location, time, game, isLoading, error } = this.props;
            
                const isGamePaused =
                  isLoading || // if game is loading
            Severity: Minor
            Found in src/containers/HeaderContent.js - About 1 hr to fix

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

                return renderer.render(
                  <Provider store={store}>
                    <ConnectedRouter history={history}>
                      <ThemeProvider theme={theme}>{component}</ThemeProvider>
                    </ConnectedRouter>
              Severity: Major
              Found in src/utils/testHelpers.js and 1 other location - About 1 hr to fix
              src/utils/testHelpers.js on lines 34..40

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

              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

                return renderer.create(
                  <Provider store={store}>
                    <ConnectedRouter history={history}>
                      <ThemeProvider theme={theme}>{component}</ThemeProvider>
                    </ConnectedRouter>
              Severity: Major
              Found in src/utils/testHelpers.js and 1 other location - About 1 hr to fix
              src/utils/testHelpers.js on lines 45..51

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

              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

              const CloseButton = styled.button`
                position: absolute;
                background-color: transparent;
                color: ${props => props.theme.colors.contrastDark.secondary};
                border: none;
              Severity: Major
              Found in src/components/Sidebar/CloseButton.js and 1 other location - About 1 hr to fix
              src/components/PlayMode.js on lines 3..18

              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

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

              const mapStateToProps = state => ({
                isSettingsOpen: state.ui.sidebars.settings,
                jarvigSettings: state.jarvig.settings,
                jarvigDifficulty: state.jarvig.difficulty,
                difficulties: state.jarvig.difficulties
              Severity: Major
              Found in src/containers/SidebarSettings.js and 1 other location - About 1 hr to fix
              src/containers/HeaderContent.js on lines 120..125

              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

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

              const mapStateToProps = state => ({
                time: state.jarvig.settings.time,
                game: state.jarvig.game,
                isLoading: state.jarvig.fetching,
                error: state.jarvig.error
              Severity: Major
              Found in src/containers/HeaderContent.js and 1 other location - About 1 hr to fix
              src/containers/SidebarSettings.js on lines 132..137

              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

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

              const PlayMode = styled.p`
                margin: 1em auto;
                color: ${props => props.theme.colors.contrastDark.secondary};
              
                & button {
              Severity: Major
              Found in src/components/PlayMode.js and 1 other location - About 1 hr to fix
              src/components/Sidebar/CloseButton.js on lines 3..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 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 2 locations. Consider refactoring.
              Open

                constructor(props) {
                  super(props);
              
                  const { push, history } = this.props;
              
              
              Severity: Major
              Found in src/containers/PlayScreen/index.js and 1 other location - About 1 hr to fix
              src/containers/ResultScreen/index.js on lines 17..25

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

              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

                constructor(props) {
                  super(props);
              
                  const { push, history } = this.props;
              
              
              Severity: Major
              Found in src/containers/ResultScreen/index.js and 1 other location - About 1 hr to fix
              src/containers/PlayScreen/index.js on lines 31..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 64.

              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

                          <Card.ActionLink
                            to="/"
                            half="true"
                            backgroundcolor="accent2"
                            color="contrastDark"
              Severity: Major
              Found in src/containers/ResultScreen/index.js and 1 other location - About 1 hr to fix
              src/containers/ResultScreen/index.js on lines 73..81

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

              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

                          <Card.ActionLink
                            to="/play"
                            half="true"
                            backgroundcolor="accent"
                            color="contrastDark"
              Severity: Major
              Found in src/containers/ResultScreen/index.js and 1 other location - About 1 hr to fix
              src/containers/ResultScreen/index.js on lines 82..90

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

              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