enclose-io/compiler

View on GitHub
lts/lib/child_process.js

Summary

Maintainability
F
3 wks
Test Coverage

Function execFile has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

function execFile(file /* , args, options, callback */) {
  let args = [];
  let callback;
  let options;

Severity: Minor
Found in lts/lib/child_process.js - About 1 day 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

File child_process.js has 535 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 lts/lib/child_process.js - About 1 day to fix

    Function execFile has 168 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function execFile(file /* , args, options, callback */) {
      let args = [];
      let callback;
      let options;
    
    
    Severity: Major
    Found in lts/lib/child_process.js - About 6 hrs to fix

      Function normalizeSpawnArguments has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

      function normalizeSpawnArguments(file, args, options) {
        validateString(file, 'file');
      
        if (file.length === 0)
          throw new ERR_INVALID_ARG_VALUE('file', file, 'cannot be empty');
      Severity: Minor
      Found in lts/lib/child_process.js - About 6 hrs 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 normalizeSpawnArguments has 100 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function normalizeSpawnArguments(file, args, options) {
        validateString(file, 'file');
      
        if (file.length === 0)
          throw new ERR_INVALID_ARG_VALUE('file', file, 'cannot be empty');
      Severity: Major
      Found in lts/lib/child_process.js - About 4 hrs to fix

        Function fork has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        function fork(modulePath /* , args, options */) {
          validateString(modulePath, 'modulePath');
        
          // Get options and args arguments.
          let execArgv;
        Severity: Minor
        Found in lts/lib/child_process.js - About 2 hrs 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 exithandler has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function exithandler(code, signal) {
            if (exited) return;
            exited = true;
        
            if (timeoutId) {
        Severity: Minor
        Found in lts/lib/child_process.js - About 1 hr to fix

          Function fork has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function fork(modulePath /* , args, options */) {
            validateString(modulePath, 'modulePath');
          
            // Get options and args arguments.
            let execArgv;
          Severity: Minor
          Found in lts/lib/child_process.js - About 1 hr to fix

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

            function spawnSync(file, args, options) {
              const opts = normalizeSpawnArguments(file, args, options);
            
              const defaults = {
                maxBuffer: MAX_BUFFER,
            Severity: Minor
            Found in lts/lib/child_process.js - About 1 hr to fix

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

              function spawnSync(file, args, options) {
                const opts = normalizeSpawnArguments(file, args, options);
              
                const defaults = {
                  maxBuffer: MAX_BUFFER,
              Severity: Minor
              Found in lts/lib/child_process.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 checkExecSyncError has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function checkExecSyncError(ret, args, cmd) {
                let err;
                if (ret.error) {
                  err = ret.error;
                } else if (ret.status !== 0) {
              Severity: Minor
              Found in lts/lib/child_process.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

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

              function execFile(file /* , args, options, callback */) {
                let args = [];
                let callback;
                let options;
              
              
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 1 wk to fix
              current/lib/child_process.js on lines 191..403

              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 1565.

              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

              function fork(modulePath /* , args, options */) {
                validateString(modulePath, 'modulePath');
              
                // Get options and args arguments.
                let execArgv;
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 2 days to fix
              current/lib/child_process.js on lines 67..122

              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 509.

              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

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

                for (let i = 0; i < options.stdio.length; i++) {
                  const input = options.stdio[i] && options.stdio[i].input;
                  if (input != null) {
                    const pipe = options.stdio[i] = { ...options.stdio[i] };
                    if (isArrayBufferView(input)) {
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 7 hrs to fix
              current/lib/child_process.js on lines 583..600

              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 193.

              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

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

              function checkExecSyncError(ret, args, cmd) {
                let err;
                if (ret.error) {
                  err = ret.error;
                } else if (ret.status !== 0) {
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 6 hrs to fix
              current/lib/child_process.js on lines 606..622

              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 164.

              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

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

              const customPromiseExecFunction = (orig) => {
                return (...args) => {
                  let resolve;
                  let reject;
                  const promise = new Promise((res, rej) => {
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 6 hrs to fix
              current/lib/child_process.js on lines 163..184

              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 157.

              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

              function _forkChild(fd, serializationMode) {
                // set process.send()
                const p = new Pipe(PipeConstants.IPC);
                p.open(fd);
                p.unref();
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 5 hrs to fix
              current/lib/child_process.js on lines 124..136

              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 153.

              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

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

              function execSync(command, options) {
                const opts = normalizeExecArgs(command, options, null);
                const inheritStderr = !opts.options.stdio;
              
                const ret = spawnSync(opts.file, opts.options);
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 4 hrs to fix
              current/lib/child_process.js on lines 643..658

              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 122.

              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

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

              function normalizeExecArgs(command, options, callback) {
                if (typeof options === 'function') {
                  callback = options;
                  options = undefined;
                }
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 3 hrs to fix
              current/lib/child_process.js on lines 138..153

              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 103.

              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

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

                if (ArrayIsArray(args)) {
                  args = args.slice(0);
                } else if (args == null) {
                  args = [];
                } else if (typeof args !== 'object') {
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 2 hrs to fix
              current/lib/child_process.js on lines 416..425

              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 88.

              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

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

                  if (process.platform === 'win32') {
                    if (typeof options.shell === 'string')
                      file = options.shell;
                    else
                      file = process.env.comspec || 'cmd.exe';
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 1 hr to fix
              current/lib/child_process.js on lines 488..508

              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 67.

              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

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

                if (options.shell != null &&
                    typeof options.shell !== 'boolean' &&
                    typeof options.shell !== 'string') {
                  throw new ERR_INVALID_ARG_TYPE('options.shell',
                                                 ['boolean', 'string'], options.shell);
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 1 hr to fix
              current/lib/child_process.js on lines 456..461

              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 63.

              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

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

              function sanitizeKillSignal(killSignal) {
                if (typeof killSignal === 'string' || typeof killSignal === 'number') {
                  return convertToValidSignal(killSignal);
                } else if (killSignal != null) {
                  throw new ERR_INVALID_ARG_TYPE('options.killSignal',
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 1 hr to fix
              current/lib/child_process.js on lines 677..685

              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 63.

              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

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

                for (const key in env) {
                  const value = env[key];
                  if (value !== undefined) {
                    envPairs.push(`${key}=${value}`);
                  }
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 1 hr to fix
              current/lib/child_process.js on lines 528..533

              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 61.

              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

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

                if (process.env.NODE_V8_COVERAGE &&
                    !ObjectPrototypeHasOwnProperty(options.env || {}, 'NODE_V8_COVERAGE')) {
                  env.NODE_V8_COVERAGE = process.env.NODE_V8_COVERAGE;
                }
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 1 hr to fix
              current/lib/child_process.js on lines 522..525

              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 59.

              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

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

                if (options.input) {
                  const stdin = options.stdio[0] = { ...options.stdio[0] };
                  stdin.input = options.input;
                }
              Severity: Major
              Found in lts/lib/child_process.js and 1 other location - About 1 hr to fix
              current/lib/child_process.js on lines 577..580

              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 59.

              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 7 locations. Consider refactoring.
              Open

              module.exports = {
                _forkChild,
                ChildProcess,
                exec,
                execFile,
              Severity: Major
              Found in lts/lib/child_process.js and 6 other locations - About 1 hr to fix
              current/lib/internal/crypto/util.js on lines 93..103
              current/lib/child_process.js on lines 687..697
              current/lib/http2.js on lines 15..25
              current/lib/internal/event_target.js on lines 562..572
              current/lib/vm.js on lines 416..426
              lts/lib/http2.js on lines 15..25

              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 57.

              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

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

              function exec(command, options, callback) {
                const opts = normalizeExecArgs(command, options, callback);
                return module.exports.execFile(opts.file,
                                               opts.options,
                                               opts.callback);
              Severity: Minor
              Found in lts/lib/child_process.js and 1 other location - About 55 mins to fix
              current/lib/child_process.js on lines 156..161

              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 53.

              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

              function validateMaxBuffer(maxBuffer) {
                if (maxBuffer != null && !(typeof maxBuffer === 'number' && maxBuffer >= 0)) {
                  throw new ERR_OUT_OF_RANGE('options.maxBuffer',
                                             'a positive number',
                                             maxBuffer);
              Severity: Minor
              Found in lts/lib/child_process.js and 1 other location - About 40 mins to fix
              current/lib/child_process.js on lines 668..674

              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 49.

              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

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

                if (typeof options.argv0 === 'string') {
                  args.unshift(options.argv0);
                } else {
                  args.unshift(file);
                }
              Severity: Minor
              Found in lts/lib/child_process.js and 1 other location - About 35 mins to fix
              current/lib/child_process.js on lines 511..515

              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

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

                    if (typeof options.shell === 'string')
                      file = options.shell;
                    else
                      file = process.env.comspec || 'cmd.exe';
              Severity: Minor
              Found in lts/lib/child_process.js and 1 other location - About 35 mins to fix
              current/lib/child_process.js on lines 489..492

              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 2 locations. Consider refactoring.
              Open

              function validateTimeout(timeout) {
                if (timeout != null && !(NumberIsInteger(timeout) && timeout >= 0)) {
                  throw new ERR_OUT_OF_RANGE('timeout', 'an unsigned integer', timeout);
                }
              }
              Severity: Minor
              Found in lts/lib/child_process.js and 1 other location - About 35 mins to fix
              current/lib/child_process.js on lines 661..665

              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 9 locations. Consider refactoring.
              Open

                if (options.windowsVerbatimArguments != null &&
                    typeof options.windowsVerbatimArguments !== 'boolean') {
                  throw new ERR_INVALID_ARG_TYPE('options.windowsVerbatimArguments',
                                                 'boolean',
                                                 options.windowsVerbatimArguments);
              Severity: Major
              Found in lts/lib/child_process.js and 8 other locations - About 35 mins to fix
              current/lib/child_process.js on lines 433..436
              current/lib/child_process.js on lines 439..443
              current/lib/child_process.js on lines 464..467
              current/lib/child_process.js on lines 470..474
              lts/lib/child_process.js on lines 428..431
              lts/lib/child_process.js on lines 434..438
              lts/lib/child_process.js on lines 459..462
              lts/lib/child_process.js on lines 465..469

              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 46.

              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 9 locations. Consider refactoring.
              Open

                if (options.cwd != null &&
                    typeof options.cwd !== 'string') {
                  throw new ERR_INVALID_ARG_TYPE('options.cwd', 'string', options.cwd);
                }
              Severity: Major
              Found in lts/lib/child_process.js and 8 other locations - About 35 mins to fix
              current/lib/child_process.js on lines 433..436
              current/lib/child_process.js on lines 439..443
              current/lib/child_process.js on lines 464..467
              current/lib/child_process.js on lines 470..474
              lts/lib/child_process.js on lines 434..438
              lts/lib/child_process.js on lines 459..462
              lts/lib/child_process.js on lines 465..469
              lts/lib/child_process.js on lines 472..477

              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 46.

              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 9 locations. Consider refactoring.
              Open

                if (options.detached != null &&
                    typeof options.detached !== 'boolean') {
                  throw new ERR_INVALID_ARG_TYPE('options.detached',
                                                 'boolean', options.detached);
                }
              Severity: Major
              Found in lts/lib/child_process.js and 8 other locations - About 35 mins to fix
              current/lib/child_process.js on lines 433..436
              current/lib/child_process.js on lines 439..443
              current/lib/child_process.js on lines 464..467
              current/lib/child_process.js on lines 470..474
              lts/lib/child_process.js on lines 428..431
              lts/lib/child_process.js on lines 459..462
              lts/lib/child_process.js on lines 465..469
              lts/lib/child_process.js on lines 472..477

              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 46.

              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 9 locations. Consider refactoring.
              Open

                if (options.argv0 != null &&
                    typeof options.argv0 !== 'string') {
                  throw new ERR_INVALID_ARG_TYPE('options.argv0', 'string', options.argv0);
                }
              Severity: Major
              Found in lts/lib/child_process.js and 8 other locations - About 35 mins to fix
              current/lib/child_process.js on lines 433..436
              current/lib/child_process.js on lines 439..443
              current/lib/child_process.js on lines 464..467
              current/lib/child_process.js on lines 470..474
              lts/lib/child_process.js on lines 428..431
              lts/lib/child_process.js on lines 434..438
              lts/lib/child_process.js on lines 465..469
              lts/lib/child_process.js on lines 472..477

              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 46.

              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 9 locations. Consider refactoring.
              Open

                if (options.windowsHide != null &&
                    typeof options.windowsHide !== 'boolean') {
                  throw new ERR_INVALID_ARG_TYPE('options.windowsHide',
                                                 'boolean', options.windowsHide);
                }
              Severity: Major
              Found in lts/lib/child_process.js and 8 other locations - About 35 mins to fix
              current/lib/child_process.js on lines 433..436
              current/lib/child_process.js on lines 439..443
              current/lib/child_process.js on lines 464..467
              current/lib/child_process.js on lines 470..474
              lts/lib/child_process.js on lines 428..431
              lts/lib/child_process.js on lines 434..438
              lts/lib/child_process.js on lines 459..462
              lts/lib/child_process.js on lines 472..477

              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 46.

              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 4 locations. Consider refactoring.
              Open

                if (options.uid != null && !isInt32(options.uid)) {
                  throw new ERR_INVALID_ARG_TYPE('options.uid', 'int32', options.uid);
                }
              Severity: Major
              Found in lts/lib/child_process.js and 3 other locations - About 35 mins to fix
              current/lib/child_process.js on lines 446..448
              current/lib/child_process.js on lines 451..453
              lts/lib/child_process.js on lines 446..448

              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 46.

              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 4 locations. Consider refactoring.
              Open

                if (options.gid != null && !isInt32(options.gid)) {
                  throw new ERR_INVALID_ARG_TYPE('options.gid', 'int32', options.gid);
                }
              Severity: Major
              Found in lts/lib/child_process.js and 3 other locations - About 35 mins to fix
              current/lib/child_process.js on lines 446..448
              current/lib/child_process.js on lines 451..453
              lts/lib/child_process.js on lines 441..443

              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 46.

              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

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

                if (options === undefined)
                  options = {};
                else if (options === null || typeof options !== 'object')
                  throw new ERR_INVALID_ARG_TYPE('options', 'object', options);
              Severity: Minor
              Found in lts/lib/child_process.js and 1 other location - About 35 mins to fix
              current/lib/child_process.js on lines 427..430

              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 46.

              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