impulsesjs/impulses

View on GitHub
src/md5.js

Summary

Maintainability
A
0 mins
Test Coverage

Function constructor has 123 lines of code (exceeds 25 allowed). Consider refactoring.
Invalid

    constructor(alwaysUseSafe = false) {
        /**** Private Attributes *************************************************************************************/

        const hexChr = '0123456789abcdef'.split('')

Severity: Major
Found in src/md5.js - About 4 hrs to fix

    Function constructor has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Invalid

        constructor(alwaysUseSafe = false) {
            /**** Private Attributes *************************************************************************************/
    
            const hexChr = '0123456789abcdef'.split('')
    
    
    Severity: Minor
    Found in src/md5.js - About 2 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 cycle has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Invalid

            function cycle(state, blocks) {
                const val_a = state[0]
                const val_b = state[1]
                const val_c = state[2]
                const val_d = state[3]
    Severity: Minor
    Found in src/md5.js - About 1 hr to fix

      Function ff has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Invalid

              function ff(a, b, c, d, x, s, t) {
      Severity: Major
      Found in src/md5.js - About 50 mins to fix

        Function hh has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Invalid

                function hh(a, b, c, d, x, s, t) {
        Severity: Major
        Found in src/md5.js - About 50 mins to fix

          Function ii has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Invalid

                  function ii(a, b, c, d, x, s, t) {
          Severity: Major
          Found in src/md5.js - About 50 mins to fix

            Function gg has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Invalid

                    function gg(a, b, c, d, x, s, t) {
            Severity: Major
            Found in src/md5.js - About 50 mins to fix

              Function cmn has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Invalid

                      function cmn(q, a, b, x, s, t) {
              Severity: Minor
              Found in src/md5.js - About 45 mins to fix

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

                                }, {method: hh, blockMap: [5,8,11,14, 1,4,7,10, 13,0,3,6, 9,12,15,2], extra: [
                                    [4, -378558],     [11, -2022574463], [16, 1839030562],  [23, -35309556],
                                    [4, -1530992060], [11, 1272893353],  [16, -155497632],  [23, -1094730640],
                                    [4, 681279174],   [11, -358537222],  [16, -722521979],  [23, 76029189],
                                    [4, -640364487],  [11, -421815835],  [16, 530742520],   [23, -995338651]]
                Severity: Major
                Found in src/md5.js and 1 other location - About 4 hrs to fix
                src/md5.js on lines 163..168

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

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

                                }, {method: gg, blockMap: [1,6,11,0, 5,10,15,4, 9,14,3,8, 13,2,7,12], extra: [
                                    [5, -165796510],  [9, -1069501632],  [14, 643717713],   [20, -373897302],
                                    [5, -701558691],  [9, 38016083],     [14, -660478335],  [20, -405537848],
                                    [5, 568446438],   [9, -1019803690],  [14, -187363961],  [20, 1163531501],
                                    [5, -1444681467], [9, -51403784],    [14, 1735328473],  [20, -1926607734]]
                Severity: Major
                Found in src/md5.js and 1 other location - About 4 hrs to fix
                src/md5.js on lines 168..173

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

                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

                There are no issues that match your filters.

                Category
                Status