Showing 2,859 of 2,859 total issues

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

    function readSharp() {
    var c = port.readChar();
    if (isWhitespace(c))
        return new sc_Token(13/*ERROR*/, "bad #-pattern0.");

Severity: Minor
Found in deps/v8/benchmarks/earley-boyer.js - About 1 hr to fix

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

    function help (args, cb) {
      npm.spinner.stop()
      var argv = npm.config.get("argv").cooked
    
      var argnum = 0
    Severity: Minor
    Found in deps/npm/lib/help.js - About 1 hr to fix

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

      Client.prototype._onResponse = function(res) {
        var cb,
            index = -1;
      
        this._reqCallbacks.some(function(fn, i) {
      Severity: Minor
      Found in lib/_debugger.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 _findPath has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      Module._findPath = function(request, paths) {
        var exts = Object.keys(Module._extensions);
      
        if (request.charAt(0) === '/') {
          paths = [''];
      Severity: Minor
      Found in lib/module.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 handleGroup has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      function handleGroup(self, group, width, maxColumns) {
        if (group.length == 0) {
          return;
        }
        var minRows = Math.ceil(group.length / maxColumns);
      Severity: Minor
      Found in lib/readline.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 testSortStability has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        function testSortStability(count, bins, sortFunc) {
          var unstable = false;
      
          for (var iter = 0; iter < 10; ++iter) {
            var array = [];
      Severity: Minor
      Found in tools/common.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 _deepEqual has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      function _deepEqual(actual, expected) {
        // 7.1. All identical values are equivalent, as determined by ===.
        if (actual === expected) {
          return true;
      
      
      Severity: Minor
      Found in lib/assert.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 _destroy has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      Socket.prototype._destroy = function(exception, cb) {
        debug('destroy');
      
        var self = this;
      
      
      Severity: Minor
      Found in lib/net.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 unpipe has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      Readable.prototype.unpipe = function(dest) {
        var state = this._readableState;
      
        // if we're not piping anywhere, then do nothing.
        if (state.pipesCount === 0)
      Severity: Minor
      Found in lib/_stream_readable.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 Stats has 14 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          dev,
          mode,
          nlink,
          uid,
          gid,
      Severity: Major
      Found in lib/fs.js - About 1 hr to fix

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

        exports.lookup = function lookup(hostname, options, callback) {
          var hints = 0;
          var family = -1;
        
          // Parse arguments
        Severity: Minor
        Found in lib/dns.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 server has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function server() {
          var serverHandle = new TCP();
          var err = serverHandle.bind('127.0.0.1', PORT);
          if (err)
            fail(err, 'bind');
        Severity: Minor
        Found in benchmark/net/tcp-raw-pipe.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 makeFile has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function makeFile() {
          var buf = new Buffer(filesize / 1024);
          if (encoding === 'utf8') {
            // ü
            for (var i = 0; i < buf.length; i++) {
        Severity: Minor
        Found in benchmark/fs/read-stream-throughput.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 clearBuffer has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function clearBuffer(stream, state) {
          state.bufferProcessing = true;
          var entry = state.bufferedRequest;
        
          if (stream._writev && entry && entry.next) {
        Severity: Minor
        Found in lib/_stream_writable.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 client has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function client() {
          var chunk;
          switch (type) {
            case 'buf':
              chunk = new Buffer(len);
        Severity: Minor
        Found in benchmark/net/tcp-raw-c2s.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 traceCommand_ has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        DebugRequest.prototype.traceCommand_ = function(args) {
          // Process arguments.
          if (args && args.length > 0) {
            if (args == 'compile') {
              trace_compile = !trace_compile;
        Severity: Minor
        Found in deps/v8/src/d8.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 installedDeep has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function installedDeep (opts, cb) {
          var local
            , global
            , depth = npm.config.get("depth")
            , opt = { depth: depth, dev: true }
        Severity: Minor
        Found in deps/npm/lib/utils/completion/installed-deep.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 get has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        Object.defineProperty(exports, "defaults", {get: function () {
          if (defaults) return defaults
        
          if (process.env.PREFIX) {
            globalPrefix = process.env.PREFIX
        Severity: Minor
        Found in deps/npm/lib/config/defaults.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 parseField has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function parseField (f, k) {
          if (typeof f !== "string" && !(f instanceof String))
            return f
        
          // type can be an array or single thing.
        Severity: Minor
        Found in deps/npm/lib/config/core.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 help has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function help (args, cb) {
          npm.spinner.stop()
          var argv = npm.config.get("argv").cooked
        
          var argnum = 0
        Severity: Minor
        Found in deps/npm/lib/help.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

        Severity
        Category
        Status
        Source
        Language