aureooms/js-mergesort

View on GitHub

Showing 5 of 5 total issues

Function _iterative has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function _iterative ( merge , copy ) {

    /**
     * Always makes at most A001855(n) comparisons.
     *
Severity: Major
Found in src/_iterative.js - About 2 hrs to fix

    Function sort has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        let sort = function ( compare , a , ai , aj , b , bi ) {
    
            let whole , left , center , right , mask , half ;
            let i , j , k ;
            let t , u , v , w , p ;
    Severity: Major
    Found in src/_iterative.js - About 2 hrs to fix

      Function _iterative has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export function _iterative ( merge , copy ) {
      
          /**
           * Always makes at most A001855(n) comparisons.
           *
      Severity: Minor
      Found in src/_iterative.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 sort has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          let sort = function ( compare , a , ai , aj , b , bi , bj ) {
      Severity: Major
      Found in src/_recursive.js - About 50 mins to fix

        Function sort has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            let sort = function ( compare , a , ai , aj , b , bi ) {
        Severity: Minor
        Found in src/_iterative.js - About 45 mins to fix
          Severity
          Category
          Status
          Source
          Language