tsg-ut/mnemo

View on GitHub

Showing 724 of 724 total issues

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

    render() {
        return (
            <g transform={this.getInitialTransform()}>
                <rect
                    x={-this.getRectangleWidth() / 2}
Severity: Minor
Found in lib/data-component.jsx - About 1 hr to fix

    Function ioGenerator has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        ioGenerator: (random) => {
            const sumOfDigits = (n) => (
                n.toString().split('').map((d) => parseInt(d)).reduce((a, b) => a + b)
            );
    
    
    Severity: Minor
    Found in stages/parity.js - About 1 hr to fix

      Function ioGenerator has 29 lines of code (exceeds 25 allowed). 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: Minor
      Found in stages/fibonacci.js - About 1 hr to fix

        Function ioGenerator has 29 lines of code (exceeds 25 allowed). 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: Minor
        Found in stages/fibonacci-hard.js - About 1 hr to fix

          Function ioGenerator has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              ioGenerator: (random) => {
                  const candidates = [0, 1, 2, 4, 6];
                  const inputs = [];
          
                  // Shuffle array and take heading 3
          Severity: Minor
          Found in stages/conditional03.js - About 1 hr to fix

            Function constructor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                constructor(config) {
                    super();
            
                    this.height = config.height;
                    this.width = config.width;
            Severity: Minor
            Found in lib/board.js - About 1 hr to fix

              Function message has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      const message = (() => {
                          if (!arrayEquals(Object.keys(block), ['x', 'y', 'type', 'rotate'])) {
                              return `keys of block ${index} are invalid`;
                          }
              
              
              Severity: Minor
              Found in lib/validator.js - About 1 hr to fix

                Function onRegister has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    async onRegister(event) {
                        const registrationStartTime = Date.now();
                
                        const name = this.$result.find('.name').val();
                        if (name.length === 0) {
                Severity: Minor
                Found in lib/stage.js - About 1 hr to fix

                  Function ioGenerator has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      ioGenerator: (random) => {
                          const candidates = Array.from({length: 13}, (item, index) => index + 2); // 2..14
                          const inputs = [];
                  
                          // Shuffle array and take heading 3
                  Severity: Minor
                  Found in stages/factorial.js - About 1 hr to fix

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

                        gt: {
                            type: 'calc2',
                            func: (a, b) => a > b ? 1 : 0,
                            io: {
                                in: ['left', 'right'],
                    Severity: Major
                    Found in lib/block-configs.js and 4 other locations - About 1 hr to fix
                    lib/block-configs.js on lines 397..405
                    lib/block-configs.js on lines 425..433
                    lib/block-configs.js on lines 434..442
                    lib/block-configs.js on lines 443..451

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

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

                        leqq: {
                            type: 'calc2',
                            func: (a, b) => a <= b ? 1 : 0,
                            io: {
                                in: ['left', 'right'],
                    Severity: Major
                    Found in lib/block-configs.js and 4 other locations - About 1 hr to fix
                    lib/block-configs.js on lines 397..405
                    lib/block-configs.js on lines 416..424
                    lib/block-configs.js on lines 425..433
                    lib/block-configs.js on lines 434..442

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

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

                        geqq: {
                            type: 'calc2',
                            func: (a, b) => a >= b ? 1 : 0,
                            io: {
                                in: ['left', 'right'],
                    Severity: Major
                    Found in lib/block-configs.js and 4 other locations - About 1 hr to fix
                    lib/block-configs.js on lines 397..405
                    lib/block-configs.js on lines 416..424
                    lib/block-configs.js on lines 434..442
                    lib/block-configs.js on lines 443..451

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

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

                        lt: {
                            type: 'calc2',
                            func: (a, b) => a < b ? 1 : 0,
                            io: {
                                in: ['left', 'right'],
                    Severity: Major
                    Found in lib/block-configs.js and 4 other locations - About 1 hr to fix
                    lib/block-configs.js on lines 397..405
                    lib/block-configs.js on lines 416..424
                    lib/block-configs.js on lines 425..433
                    lib/block-configs.js on lines 443..451

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

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

                        equal: {
                            type: 'calc2',
                            func: (a, b) => a === b ? 1 : 0,
                            io: {
                                in: ['left', 'right'],
                    Severity: Major
                    Found in lib/block-configs.js and 4 other locations - About 1 hr to fix
                    lib/block-configs.js on lines 416..424
                    lib/block-configs.js on lines 425..433
                    lib/block-configs.js on lines 434..442
                    lib/block-configs.js on lines 443..451

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

                    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

                        junctionR: {
                            type: 'wireF',
                            io: {
                                flow: {
                                    top: ['right'],
                    Severity: Major
                    Found in lib/block-configs.js and 1 other location - About 1 hr to fix
                    lib/block-configs.js on lines 64..75

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

                    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

                        junctionL: {
                            type: 'wireF',
                            io: {
                                flow: {
                                    top: ['left'],
                    Severity: Major
                    Found in lib/block-configs.js and 1 other location - About 1 hr to fix
                    lib/block-configs.js on lines 52..63

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

                    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

                            }, {
                                test: /\.js$/,
                                include: [
                                    path.resolve(__dirname, 'node_modules/react-hammerjs'),
                                ],
                    Severity: Minor
                    Found in webpack.config.js and 1 other location - About 55 mins to fix
                    webpack.config-mocha.js on lines 12..26

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

                    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

                            }, {
                                test: /\.js$/,
                                include: [
                                    path.resolve(__dirname, 'node_modules/react-hammerjs'),
                                ],
                    Severity: Minor
                    Found in webpack.config-mocha.js and 1 other location - About 55 mins to fix
                    webpack.config.js on lines 18..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 54.

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

                        takeAndPlace(x, y, blockName) {
                            const oldBlock = this.boardComponent.getBlock(x, y);
                            assert(oldBlock, 'oldBlock is invalid');
                    
                            if (!blockName || blockName === oldBlock.config.name) { // rotate the block
                    Severity: Minor
                    Found in lib/stage.js - About 55 mins 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 ioGenerator has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        ioGenerator: (random) => {
                            const numbers = [0, 0, 0];
                            const primes = [2];
                            for (let i = 3; i < 256; i++) {
                                let flag = null;
                    Severity: Minor
                    Found in stages/factorization.js - About 55 mins 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

                    Severity
                    Category
                    Status
                    Source
                    Language