Showing 22 of 39 total issues
Function Env
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
function Env(input, output, settings, cli, buildSettings) {
// shortcuts
var join = path.join;
// electrify version
- 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
Function Env
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Env(input, output, settings, cli, buildSettings) {
// shortcuts
var join = path.join;
// electrify version
Function package
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
Electron.prototype.package = function(packager_options, done) {
var packager = require('electron-packager');
var electronVersion = requireElectron('package.json').version.replace(/^v/, '');
Function package
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Electron.prototype.package = function(packager_options, done) {
var packager = require('electron-packager');
var electronVersion = requireElectron('package.json').version.replace(/^v/, '');
- 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
Function parse_packager_options
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parse_packager_options(){
var names = [
// all platforms
'--all',
'--app-copyright',
Function start
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
MongoDB.prototype.start = function(done) {
if (this.$.env.app.config.mongo) {
if (typeof this.$.env.app.config.mongo === 'object' && this.$.env.app.config.mongo.MONGO_URL) {
this.log.info('Use external MONGO_URL');
this.env.MONGO_URL = this.$.env.app.config.mongo.MONGO_URL;
Function bundle_meteor
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
App.prototype.bundle_meteor = function( /* server_url, */ done) {
this.log.info('bundling meteor');
var tmp_dir = join(this.$.env.core.tmp, 'bundling');
var bundled_dir = join(tmp_dir, 'bundle');
Function Socket
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Socket($, logger){
this.$ = $;
this.log = require('../log')($, 'electrify:plugins:socket');
this.name = 'socket';
Function start
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
NodeJS.prototype.start = function(done) {
this.env = {
ELECTRIFY_VERSION : this.$.env.version,
ELECTRIFY_API_VERSION : this.$.env.apiVersion,
ELECTRON_VERSION : process.versions.electron,
Function ensure_deps
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
App.prototype.ensure_deps = function(done) {
this.log.info('ensuring electrify dependencies');
var npm_cmd = 'npm' + (this.$.env.os.is_windows ? '.cmd' : '');
// in development mode, use local electrify version
Function prepare
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Scaffold.prototype.prepare = function() {
this.log.info('ensuring basic structure');
shell.mkdir('-p' , this.$.env.app.bin);
Function electrify
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function electrify() {
var input;
// validates input dir (app-root folder)
if(program.input && !fs.existsSync(program.input)) {
Function start
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
MongoDB.prototype.start = function(done) {
if (this.$.env.app.config.mongo) {
if (typeof this.$.env.app.config.mongo === 'object' && this.$.env.app.config.mongo.MONGO_URL) {
this.log.info('Use external MONGO_URL');
this.env.MONGO_URL = this.$.env.app.config.mongo.MONGO_URL;
- 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
Function ensure_deps
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
App.prototype.ensure_deps = function(done) {
this.log.info('ensuring electrify dependencies');
var npm_cmd = 'npm' + (this.$.env.os.is_windows ? '.cmd' : '');
// in development mode, use local electrify version
- 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
Function Env
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function Env(input, output, settings, cli, buildSettings) {
Function afterCopy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function(buildPath, electronVersion, platform, arch, callback) {
Function Electrify
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function Electrify(input, output, settings, cli, buildSettings) {
Function exports
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function(input, output, settings, cli, buildSettings){
Function exports
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function(input, output, settings, cli, buildSettings) {
Function acquire
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
MongoDB.prototype.acquire = function(done){
if(!fs.existsSync(this.app_mongo_path) || this.$.env.plugins.aquiringVersionMissmatch) {
this.log.info('acquiring mongo');
shell.cp(this.$.env.meteor.mongo, this.$.env.app.bin);
} else
- 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"