Cellarise/oauth-rest-atlassian

View on GitHub
lib/sha1.js

Summary

Maintainability
C
1 day
Test Coverage

Function rstr2b64 has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function rstr2b64(input) {
    try {
        b64pad; //jshint ignore:line
    } catch (e) {
        b64pad = '';
Severity: Minor
Found in lib/sha1.js - About 1 hr 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 binb_sha1 has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function binb_sha1(x, len) {
    /* append padding */
    x[len >> 5] |= 0x80 << (24 - len % 32); //jshint ignore:line
    x[((len + 64 >> 9) << 4) + 15] = len; //jshint ignore:line

Severity: Minor
Found in lib/sha1.js - About 1 hr to fix

    Function str2rstr_utf8 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    function str2rstr_utf8(input) {
        var output = "";
        var i = -1;
        var x, y;
    
    
    Severity: Minor
    Found in lib/sha1.js - About 1 hr 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 rstr2any has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function rstr2any(input, encoding) {
        var divisor = encoding.length;
        var remainders = Array(); //jshint ignore:line
        var i, q, x, quotient;
    
    
    Severity: Minor
    Found in lib/sha1.js - About 1 hr to fix

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

      function rstr2any(input, encoding) {
          var divisor = encoding.length;
          var remainders = Array(); //jshint ignore:line
          var i, q, x, quotient;
      
      
      Severity: Minor
      Found in lib/sha1.js - About 1 hr 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 str2rstr_utf8 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function str2rstr_utf8(input) {
          var output = "";
          var i = -1;
          var x, y;
      
      
      Severity: Minor
      Found in lib/sha1.js - About 1 hr to fix

        Function binb_sha1 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        function binb_sha1(x, len) {
            /* append padding */
            x[len >> 5] |= 0x80 << (24 - len % 32); //jshint ignore:line
            x[((len + 64 >> 9) << 4) + 15] = len; //jshint ignore:line
        
        
        Severity: Minor
        Found in lib/sha1.js - About 35 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 sha1_kt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function sha1_kt(t) {
            return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
                (t < 60) ? -1894007588 : -899497514;
        }
        Severity: Minor
        Found in lib/sha1.js - About 25 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

        There are no issues that match your filters.

        Category
        Status