leonitousconforti/tinyburg

View on GitHub
common/scripts/install-run.js

Summary

Maintainability
F
4 days
Test Coverage

File install-run.js has 459 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// THIS FILE WAS GENERATED BY A TOOL. ANY MANUAL MODIFICATIONS WILL GET OVERWRITTEN WHENEVER RUSH IS UPGRADED.
//
// This script is intended for usage in an automated build environment where a Node tool may not have
// been preinstalled, or may have an unpredictable version.  This script will automatically install the specified
// version of the specified tool (if not already installed), and then pass a command-line to it.
Severity: Minor
Found in common/scripts/install-run.js - About 7 hrs to fix

    Function 679877 has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "isVariableSetInNpmrcFile": () => (/* binding */ isVariableSetInNpmrcFile),
    Severity: Major
    Found in common/scripts/install-run.js - About 4 hrs to fix

      Function _trimNpmrcFile has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function _trimNpmrcFile(options) {
          const { sourceNpmrcPath, linesToPrepend, linesToAppend } = options;
          const combinedNpmrcFromCache = _combinedNpmrcMap.get(sourceNpmrcPath);
          if (combinedNpmrcFromCache !== undefined) {
              return combinedNpmrcFromCache;
      Severity: Minor
      Found in common/scripts/install-run.js - About 1 hr to fix

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

        function installAndRun(logger, packageName, packageVersion, packageBinName, packageBinArgs, lockFilePath = process.env[INSTALL_RUN_LOCKFILE_PATH_VARIABLE]) {
            const rushJsonFolder = findRushJsonFolder();
            const rushCommonFolder = path__WEBPACK_IMPORTED_MODULE_3__.join(rushJsonFolder, 'common');
            const rushTempFolder = _getRushTempFolder(rushCommonFolder);
            const packageInstallFolder = _ensureAndJoinPath(rushTempFolder, 'install-run', `${packageName}@${packageVersion}`);
        Severity: Minor
        Found in common/scripts/install-run.js - About 1 hr to fix

          Function syncNpmrc has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function syncNpmrc(options) {
              const { sourceNpmrcFolder, targetNpmrcFolder, useNpmrcPublish, logger = {
                  // eslint-disable-next-line no-console
                  info: console.log,
                  // eslint-disable-next-line no-console
          Severity: Minor
          Found in common/scripts/install-run.js - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                                if (!process.env[environmentVariableName]) {
                                    // No, so trim this line
                                    lineShouldBeTrimmed = true;
                                    break;
                                }
            Severity: Major
            Found in common/scripts/install-run.js - About 45 mins to fix

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

              function installAndRun(logger, packageName, packageVersion, packageBinName, packageBinArgs, lockFilePath = process.env[INSTALL_RUN_LOCKFILE_PATH_VARIABLE]) {
              Severity: Minor
              Found in common/scripts/install-run.js - About 45 mins to fix

                Function _installPackage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function _installPackage(logger, packageInstallFolder, name, version, command) {
                Severity: Minor
                Found in common/scripts/install-run.js - About 35 mins to fix

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

                  /******/     function __webpack_require__(moduleId) {
                  /******/         // Check if module is in cache
                  /******/         var cachedModule = __webpack_module_cache__[moduleId];
                  /******/         if (cachedModule !== undefined) {
                  /******/             return cachedModule.exports;
                  Severity: Major
                  Found in common/scripts/install-run.js and 1 other location - About 5 hrs to fix
                  common/scripts/install-run-rush.js on lines 45..63

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

                  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

                  /******/     (() => {
                  /******/         // define getter functions for harmony exports
                  /******/         __webpack_require__.d = (exports, definition) => {
                  /******/             for(var key in definition) {
                  /******/                 if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
                  Severity: Major
                  Found in common/scripts/install-run.js and 1 other location - About 4 hrs to fix
                  common/scripts/install-run-rush.js on lines 79..88

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

                  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

                  /******/     (() => {
                  /******/         // define __esModule on exports
                  /******/         __webpack_require__.r = (exports) => {
                  /******/             if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
                  /******/                 Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
                  Severity: Major
                  Found in common/scripts/install-run.js and 1 other location - About 4 hrs to fix
                  common/scripts/install-run-rush.js on lines 96..104

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

                  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

                  /******/     (() => {
                  /******/         // getDefaultExport function for compatibility with non-harmony modules
                  /******/         __webpack_require__.n = (module) => {
                  /******/             var getter = module && module.__esModule ?
                  /******/                 () => (module['default']) :
                  Severity: Major
                  Found in common/scripts/install-run.js and 1 other location - About 3 hrs to fix
                  common/scripts/install-run-rush.js on lines 67..76

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

                  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

                  /******/     (() => {
                  /******/         __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
                  /******/     })();
                  Severity: Major
                  Found in common/scripts/install-run.js and 1 other location - About 1 hr to fix
                  common/scripts/install-run-rush.js on lines 91..93

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

                  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