src/node.js

Summary

Maintainability
F
3 days
Test Coverage

File node.js has 559 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
Severity: Major
Found in src/node.js - About 1 day to fix

    Function processNextTick has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      startup.processNextTick = function() {
        var nextTickQueue = [];
        var microtasksScheduled = false;
    
        // Used to run V8's micro task queue.
    Severity: Major
    Found in src/node.js - About 3 hrs to fix

      Function startup has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function startup() {
          var EventEmitter = NativeModule.require('events').EventEmitter;
      
          process.__proto__ = Object.create(EventEmitter.prototype, {
            constructor: {
      Severity: Major
      Found in src/node.js - About 3 hrs to fix

        Function processStdio has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          startup.processStdio = function() {
            var stdin, stdout, stderr;
        
            process.__defineGetter__('stdout', function() {
              if (stdout) return stdout;
        Severity: Major
        Found in src/node.js - About 2 hrs to fix

          Function createWritableStdioStream has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function createWritableStdioStream(fd) {
              var stream;
              var tty_wrap = process.binding('tty_wrap');
          
              // Note stream._type is used for test-module-load-list.js
          Severity: Minor
          Found in src/node.js - About 1 hr to fix

            Function processSignalHandlers has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              startup.processSignalHandlers = function() {
                // Load events module in order to access prototype elements on process like
                // process.addListener.
                var signalWraps = {};
                var addListener = process.addListener;
            Severity: Minor
            Found in src/node.js - About 1 hr to fix

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

                startup.processKillAndExit = function() {
              
                  process.exit = function(code) {
                    if (code || code === 0)
                      process.exitCode = code;
              Severity: Minor
              Found in src/node.js - About 1 hr to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                      stdout.destroy = stdout.destroySoon = function(er) {
                        er = er || new Error('process.stdout cannot be closed.');
                        stdout.emit('error', er);
                      };
                Severity: Minor
                Found in src/node.js and 1 other location - About 50 mins to fix
                src/node.js on lines 521..524

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 52.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                      stderr.destroy = stderr.destroySoon = function(er) {
                        er = er || new Error('process.stderr cannot be closed.');
                        stderr.emit('error', er);
                      };
                Severity: Minor
                Found in src/node.js and 1 other location - About 50 mins to fix
                src/node.js on lines 506..509

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 52.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                    global.clearTimeout = function() {
                      var t = NativeModule.require('timers');
                      return t.clearTimeout.apply(this, arguments);
                    };
                Severity: Major
                Found in src/node.js and 5 other locations - About 35 mins to fix
                src/node.js on lines 184..187
                src/node.js on lines 189..192
                src/node.js on lines 199..202
                src/node.js on lines 204..207
                src/node.js on lines 209..212

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 47.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                    global.setInterval = function() {
                      var t = NativeModule.require('timers');
                      return t.setInterval.apply(this, arguments);
                    };
                Severity: Major
                Found in src/node.js and 5 other locations - About 35 mins to fix
                src/node.js on lines 184..187
                src/node.js on lines 194..197
                src/node.js on lines 199..202
                src/node.js on lines 204..207
                src/node.js on lines 209..212

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 47.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                    global.clearInterval = function() {
                      var t = NativeModule.require('timers');
                      return t.clearInterval.apply(this, arguments);
                    };
                Severity: Major
                Found in src/node.js and 5 other locations - About 35 mins to fix
                src/node.js on lines 184..187
                src/node.js on lines 189..192
                src/node.js on lines 194..197
                src/node.js on lines 204..207
                src/node.js on lines 209..212

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 47.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                    global.setImmediate = function() {
                      var t = NativeModule.require('timers');
                      return t.setImmediate.apply(this, arguments);
                    };
                Severity: Major
                Found in src/node.js and 5 other locations - About 35 mins to fix
                src/node.js on lines 184..187
                src/node.js on lines 189..192
                src/node.js on lines 194..197
                src/node.js on lines 199..202
                src/node.js on lines 209..212

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 47.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                    global.clearImmediate = function() {
                      var t = NativeModule.require('timers');
                      return t.clearImmediate.apply(this, arguments);
                    };
                Severity: Major
                Found in src/node.js and 5 other locations - About 35 mins to fix
                src/node.js on lines 184..187
                src/node.js on lines 189..192
                src/node.js on lines 194..197
                src/node.js on lines 199..202
                src/node.js on lines 204..207

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 47.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                    global.setTimeout = function() {
                      var t = NativeModule.require('timers');
                      return t.setTimeout.apply(this, arguments);
                    };
                Severity: Major
                Found in src/node.js and 5 other locations - About 35 mins to fix
                src/node.js on lines 189..192
                src/node.js on lines 194..197
                src/node.js on lines 199..202
                src/node.js on lines 204..207
                src/node.js on lines 209..212

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 47.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status