shadowproject/shadow

View on GitHub
src/qt/res/assets/plugins/md5/md5.js

Summary

Maintainability
F
3 days
Test Coverage

Function hash has 164 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Md5.prototype.hash = function () {
    var a, b, c, d, bc, da, blocks = this.blocks;

    if (this.first) {
      a = blocks[0] - 680876937;
Severity: Major
Found in src/qt/res/assets/plugins/md5/md5.js - About 6 hrs to fix

    File md5.js has 411 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * [js-md5]{@link https://github.com/emn178/js-md5}
     *
     * @namespace md5
     * @version 0.4.1
    Severity: Minor
    Found in src/qt/res/assets/plugins/md5/md5.js - About 5 hrs to fix

      Function update has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        Md5.prototype.update = function (message) {
          if (this.finalized) {
            return;
          }
          var notString = typeof(message) != 'string';
      Severity: Major
      Found in src/qt/res/assets/plugins/md5/md5.js - About 3 hrs to fix

        Avoid deeply nested control flow statements.
        Open

                    if (code < 0x80) {
                      buffer8[i++] = code;
                    } else if (code < 0x800) {
                      buffer8[i++] = 0xc0 | (code >> 6);
                      buffer8[i++] = 0x80 | (code & 0x3f);
        Severity: Major
        Found in src/qt/res/assets/plugins/md5/md5.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      if (code < 0x80) {
                        blocks[i >> 2] |= code << SHIFT[i++ & 3];
                      } else if (code < 0x800) {
                        blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
                        blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
          Severity: Major
          Found in src/qt/res/assets/plugins/md5/md5.js - About 45 mins to fix

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

                    blocks[16] = blocks[1] = blocks[2] = blocks[3] =
                    blocks[4] = blocks[5] = blocks[6] = blocks[7] =
                    blocks[8] = blocks[9] = blocks[10] = blocks[11] =
                    blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
            Severity: Major
            Found in src/qt/res/assets/plugins/md5/md5.js and 1 other location - About 4 hrs to fix
            src/qt/res/assets/plugins/md5/md5.js on lines 285..288

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

            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

                  blocks[16] = blocks[1] = blocks[2] = blocks[3] =
                  blocks[4] = blocks[5] = blocks[6] = blocks[7] =
                  blocks[8] = blocks[9] = blocks[10] = blocks[11] =
                  blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
            Severity: Major
            Found in src/qt/res/assets/plugins/md5/md5.js and 1 other location - About 4 hrs to fix
            src/qt/res/assets/plugins/md5/md5.js on lines 201..204

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

            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