tools/cli/dev-bundle.js
Function getDevBundleForRelease
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getDevBundleForRelease(release) {
var parts = release.split("@");
if (parts.length < 2) {
return null;
}
Function getDevBundleDir
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getDevBundleDir() {
// Note that this code does not care if we are running meteor from a
// checkout, because it's always better to respect the .meteor/release
// file of the current app, if possible.
Function statOrNull
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
function statOrNull(path, statMethod) {
try {
var stat = fs.statSync(path);
} catch (e) {
if (e.code !== "ENOENT") {
- Read upRead up
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
Avoid too many return
statements within this function. Open
Open
return new Promise(function (resolve, reject) {
db.get(
"SELECT content FROM releaseVersions WHERE track=? AND version=?",
[track, version],
function (error, data) {
Avoid too many return
statements within this function. Open
Open
return Promise.resolve(
getDevBundleForRelease(release)
).then(function (devBundleDir) {
if (devBundleDir) {
links.makeLink(devBundleDir, devBundleLink);
Function getDevBundleDir
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function getDevBundleDir() {
// Note that this code does not care if we are running meteor from a
// checkout, because it's always better to respect the .meteor/release
// file of the current app, if possible.
- Read upRead up
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"