partkeepr/PartKeepr

View on GitHub
src/PartKeepr/FrontendBundle/Resources/public/js/Util/Crypto/isaac.js

Summary

Maintainability
D
1 day
Test Coverage

Function isaac has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

var isaac = (function(){

  /* private: internal states */
  var m = Array(256), // internal memory
      acc = 0,        // accumulator
Severity: Minor
Found in src/PartKeepr/FrontendBundle/Resources/public/js/Util/Crypto/isaac.js - About 6 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 isaac has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var isaac = (function(){

  /* private: internal states */
  var m = Array(256), // internal memory
      acc = 0,        // accumulator
Severity: Major
Found in src/PartKeepr/FrontendBundle/Resources/public/js/Util/Crypto/isaac.js - About 4 hrs to fix

    Function seed has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function seed(s) {
        var a, b, c, d, e, f, g, h, i;
    
        /* seeding the seeds of love */
        a = b = c = d =

      Function toIntArray has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      String.prototype.toIntArray = function() {
        var w1, w2, u, r4 = [], r = [], i = 0;
        var s = this + '\0\0\0'; // pad string to avoid discarding last chars
        var l = s.length - 1;
      
      

        Function toIntArray has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        String.prototype.toIntArray = function() {
          var w1, w2, u, r4 = [], r = [], i = 0;
          var s = this + '\0\0\0'; // pad string to avoid discarding last chars
          var l = s.length - 1;
        
        

        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

        There are no issues that match your filters.

        Category
        Status