jashkenas/underscore

View on GitHub

Showing 115 of 117 total issues

Function template has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function template(text, settings, oldSettings) {
  if (!settings && oldSettings) settings = oldSettings;
  settings = defaults({}, settings, _$1.templateSettings);

  // Combine delimiters into one regular expression via alternation.
Severity: Minor
Found in underscore-esm.js - About 1 hr to fix

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

    export default function debounce(func, wait, immediate) {
      var timeout, previous, args, result, context;
    
      var later = function() {
        var passed = now() - previous;
    Severity: Minor
    Found in modules/debounce.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 debounce has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    function debounce(func, wait, immediate) {
      var timeout, previous, args, result, context;
    
      var later = function() {
        var passed = now() - previous;
    Severity: Minor
    Found in underscore-esm.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 max has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function max(obj, iteratee, context) {
      var result = -Infinity, lastComputed = -Infinity,
          value, computed;
      if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {
        obj = isArrayLike(obj) ? obj : values(obj);
    Severity: Minor
    Found in modules/max.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 min has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function min(obj, iteratee, context) {
      var result = Infinity, lastComputed = Infinity,
          value, computed;
      if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {
        obj = isArrayLike(obj) ? obj : values(obj);
    Severity: Minor
    Found in modules/min.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 throttle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function throttle(func, wait, options) {
        var timeout, context, args, result;
        var previous = 0;
        if (!options) options = {};
    
    
    Severity: Minor
    Found in underscore-umd.js - About 1 hr to fix

      Function throttle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function throttle(func, wait, options) {
        var timeout, context, args, result;
        var previous = 0;
        if (!options) options = {};
      
      
      Severity: Minor
      Found in modules/throttle.js - About 1 hr to fix

        Function throttle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function throttle(func, wait, options) {
            var timeout, context, args, result;
            var previous = 0;
            if (!options) options = {};
        
        
        Severity: Minor
        Found in underscore.js - About 1 hr to fix

          Function throttle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function throttle(func, wait, options) {
            var timeout, context, args, result;
            var previous = 0;
            if (!options) options = {};
          
          
          Severity: Minor
          Found in underscore-esm.js - About 1 hr to fix

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

            function min(obj, iteratee, context) {
              var result = Infinity, lastComputed = Infinity,
                  value, computed;
              if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {
                obj = isArrayLike(obj) ? obj : values(obj);
            Severity: Minor
            Found in underscore-esm.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 exports has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function(config) {
              if ( !process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY ) {
                console.log('Sauce environments not set --- Skipping');
                return process.exit(0);
              }
            Severity: Minor
            Found in karma.conf-sauce.js - About 1 hr to fix

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

              export default function intersection(array) {
                var result = [];
                var argsLength = arguments.length;
                for (var i = 0, length = getLength(array); i < length; i++) {
                  var item = array[i];
              Severity: Minor
              Found in modules/intersection.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 result has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              function result(obj, path, fallback) {
                path = toPath(path);
                var length = path.length;
                if (!length) {
                  return isFunction$1(fallback) ? fallback.call(obj) : fallback;
              Severity: Minor
              Found in underscore-esm.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 max has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              function max(obj, iteratee, context) {
                var result = -Infinity, lastComputed = -Infinity,
                    value, computed;
                if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {
                  obj = isArrayLike(obj) ? obj : values(obj);
              Severity: Minor
              Found in underscore-esm.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 intersection has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              function intersection(array) {
                var result = [];
                var argsLength = arguments.length;
                for (var i = 0, length = getLength(array); i < length; i++) {
                  var item = array[i];
              Severity: Minor
              Found in underscore-esm.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 result has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function result(obj, path, fallback) {
                path = toPath(path);
                var length = path.length;
                if (!length) {
                  return isFunction(fallback) ? fallback.call(obj) : fallback;
              Severity: Minor
              Found in modules/result.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 debounce has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function debounce(func, wait, immediate) {
                  var timeout, previous, args, result, context;
              
                  var later = function() {
                    var passed = now() - previous;
              Severity: Minor
              Found in underscore-umd.js - About 1 hr to fix

                Function debounce has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function debounce(func, wait, immediate) {
                  var timeout, previous, args, result, context;
                
                  var later = function() {
                    var passed = now() - previous;
                Severity: Minor
                Found in underscore-esm.js - About 1 hr to fix

                  Function debounce has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function debounce(func, wait, immediate) {
                    var timeout, previous, args, result, context;
                  
                    var later = function() {
                      var passed = now() - previous;
                  Severity: Minor
                  Found in modules/debounce.js - About 1 hr to fix

                    Function debounce has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function debounce(func, wait, immediate) {
                        var timeout, previous, args, result, context;
                    
                        var later = function() {
                          var passed = now() - previous;
                    Severity: Minor
                    Found in underscore.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language