lib/service.js
Function listen
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Service.prototype.listen = function() {
const self = this;
return new Promise(function(resolve, reject) {
Function tick
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tick() {
let setup = false; //whether the service is "setup" and ready
self.once('listening', onServiceListening);
self.once('error', onServiceError);
Function $setProjectRoot
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
Service.prototype.$setProjectRoot = function(dir) {
var p = dir || process.cwd();
while ((fs.statSync(p)).isDirectory()) {
try {
- 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 $initAppWatcher
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
Service.prototype.$initAppWatcher = function() {
const service = this
let numOfOKApps = 0;
this.appManager.on('build-app', onBuildApp);
- 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"