tsg-ut/mnemo

View on GitHub

Showing 724 of 724 total issues

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

    ioGenerator: (random) => {
        const fibonacci = [1, 1];

        for (let i = 2; i < 20; i++) {
            fibonacci.push(fibonacci[fibonacci.length - 1] + fibonacci[fibonacci.length - 2]);
Severity: Major
Found in stages/fibonacci.js and 1 other location - About 2 days to fix
stages/fibonacci-hard.js on lines 35..73

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

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

    ioGenerator: (random) => {
        const fibonacci = [1, 1];

        for (let i = 2; i < 30; i++) {
            fibonacci.push(fibonacci[fibonacci.length - 1] + fibonacci[fibonacci.length - 2]);
Severity: Major
Found in stages/fibonacci-hard.js and 1 other location - About 2 days to fix
stages/fibonacci.js on lines 28..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 375.

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

File board-component.jsx has 780 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const React = require('react');
const PropTypes = require('prop-types');
const {default: Hammer} = require('react-hammerjs');
const {INPUT_MOVE, INPUT_END} = (typeof window === 'undefined') ? {} : require('hammerjs');
const {default: Measure} = require('react-measure');
Severity: Major
Found in lib/board-component.jsx - About 1 day to fix

    Function step has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
    Open

        step() {
            this.inputExists = false;
    
            switch (this.config.type) {
                case 'empty': {
    Severity: Minor
    Found in lib/block.js - About 1 day 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

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

    module.exports = {
        name: 'binarian-easy',
        version: 3,
        parts: {
            wireI: null,
    Severity: Major
    Found in stages/binarian-easy.js and 3 other locations - About 1 day to fix
    stages/complement-of-2.js on lines 1..59
    stages/perfect-number.js on lines 1..59
    stages/reversal.js on lines 1..59

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

    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

    module.exports = {
        name: 'complement-of-2',
        version: 3,
        parts: {
            wireI: null,
    Severity: Major
    Found in stages/complement-of-2.js and 3 other locations - About 1 day to fix
    stages/binarian-easy.js on lines 1..59
    stages/perfect-number.js on lines 1..59
    stages/reversal.js on lines 1..59

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

    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

    module.exports = {
        name: 'reversal',
        version: 3,
        parts: {
            wireI: null,
    Severity: Major
    Found in stages/reversal.js and 3 other locations - About 1 day to fix
    stages/binarian-easy.js on lines 1..59
    stages/complement-of-2.js on lines 1..59
    stages/perfect-number.js on lines 1..59

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

    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

    module.exports = {
        name: 'perfect-number',
        version: 3,
        parts: {
            wireI: null,
    Severity: Major
    Found in stages/perfect-number.js and 3 other locations - About 1 day to fix
    stages/binarian-easy.js on lines 1..59
    stages/complement-of-2.js on lines 1..59
    stages/reversal.js on lines 1..59

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

    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

    module.exports = {
        name: 'seq02',
        version: 1,
        parts: {
            wireI: null,
    Severity: Major
    Found in stages/seq02.js and 1 other location - About 1 day to fix
    stages/max.js on lines 1..107

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

    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

    module.exports = {
        name: 'max',
        version: 3,
        parts: {
            wireI: null,
    Severity: Major
    Found in stages/max.js and 1 other location - About 1 day to fix
    stages/seq02.js on lines 1..107

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

    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

    File block-configs.js has 549 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const util = require('./util');
    
    module.exports = {
        empty: {
            type: 'empty',
    Severity: Major
    Found in lib/block-configs.js - About 1 day to fix

      File stages.js has 509 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-env node, mocha */
      /* eslint no-unused-expressions: 'off' */
      
      const chai = require('chai');
      const chaiHttp = require('chai-http');
      Severity: Major
      Found in api/test/routes/stages.js - About 1 day to fix

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

            parts: {
                wireI: null,
                wireL: null,
                wireT: null,
                wireX: null,
        Severity: Major
        Found in stages/msd.js and 1 other location - About 7 hrs to fix
        stages/sqrt-hard.js on lines 4..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 181.

        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

            parts: {
                wireI: null,
                wireL: null,
                wireT: null,
                wireX: null,
        Severity: Major
        Found in stages/sqrt-hard.js and 1 other location - About 7 hrs to fix
        stages/msd.js on lines 4..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 181.

        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

        File stage.js has 469 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* global ga */
        
        const $ = require('jquery');
        const assert = require('assert');
        const React = require('react');
        Severity: Minor
        Found in lib/stage.js - About 7 hrs to fix

          BoardComponent has 48 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class BoardComponent extends React.Component {
              static propTypes = {
                  status: PropTypes.string.isRequired,
                  width: PropTypes.number.isRequired,
                  height: PropTypes.number.isRequired,
          Severity: Minor
          Found in lib/board-component.jsx - About 6 hrs to fix

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

                render() {
                    return (
                        <Hammer
                            onPan={this.handlePan}
                            onPanStart={this.handlePan}
            Severity: Major
            Found in lib/board-component.jsx - About 6 hrs to fix

              Function step has 151 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  step() {
                      this.inputExists = false;
              
                      switch (this.config.type) {
                          case 'empty': {
              Severity: Major
              Found in lib/block.js - About 6 hrs to fix

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

                    parts: {
                        wireI: null,
                        wireL: null,
                        wireT: null,
                        wireX: null,
                Severity: Major
                Found in stages/gcd.js and 1 other location - About 5 hrs to fix
                stages/lcm.js on lines 4..34

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

                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

                    parts: {
                        wireI: null,
                        wireL: null,
                        wireT: null,
                        wireX: null,
                Severity: Major
                Found in stages/lcm.js and 1 other location - About 5 hrs to fix
                stages/gcd.js on lines 4..34

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

                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