meteor/meteor

View on GitHub
tools/packaging/warehouse.js

Summary

Maintainability
D
1 day
Test Coverage

Function _populateWarehouseForRelease has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

  _populateWarehouseForRelease: function (releaseVersion, showInstalling) {
    var releasesDir = files.pathJoin(warehouse.getWarehouseDir(), 'releases');
    files.mkdir_p(releasesDir, 0o755);
    var releaseManifestPath = files.pathJoin(releasesDir,
                                             releaseVersion + '.release.json');
Severity: Minor
Found in tools/packaging/warehouse.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

Function _populateWarehouseForRelease has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _populateWarehouseForRelease: function (releaseVersion, showInstalling) {
    var releasesDir = files.pathJoin(warehouse.getWarehouseDir(), 'releases');
    files.mkdir_p(releasesDir, 0o755);
    var releaseManifestPath = files.pathJoin(releasesDir,
                                             releaseVersion + '.release.json');
Severity: Major
Found in tools/packaging/warehouse.js - About 4 hrs to fix

    File warehouse.js has 259 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // This file is used to access the "warehouse" of pre-0.9.0 releases. This code
    // is now legacy, but we keep it around so that you can still use the same
    // `meteor` entry point to run pre-0.9.0 and post-0.9.0 releases, for now. All
    // it knows how to do is download old releases and explain to main.js how to
    // exec them.
    Severity: Minor
    Found in tools/packaging/warehouse.js - About 2 hrs to fix

      There are no issues that match your filters.

      Category
      Status