Showing 100 of 247 total issues
Function start
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.start = function(domain) {
var self = this;
domain = domain || Constants.Task.DefaultDomain;
return Promise.all([store.getGraphDefinitions(), store.getServiceGraphs()])
Function executeTasks
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function executeTasks(data, timeout) {
var handleExecResult = function(_task, _done, error, stdout, stderr) {
_task.stdout = stdout;
_task.stderr = stderr;
_task.error = error;
Function start
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
SchedulerServer.prototype.start = function() {
var self = this;
return Promise.try(function() {
var grpc = require('grpc');
Function runTask
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
TaskRunner.prototype.runTask = function(data) {
var self = this;
return Rx.Observable.just(data)
.flatMap(function(_data) {
return Task.create(
Function taskSchedulerFactory
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
eventsProtocol,
store,
LeaseExpirationPoller,
Constants,
Logger,
Function profileApiServiceFactory
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
Promise,
workflowApiService,
taskProtocol,
eventsProtocol,
waterline,
Function swaggerFactory
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
Promise,
Errors,
_,
injector,
views,
Function parseDriveWwid
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseDriveWwid(idList) {
//idList example
//"lrwxrwxrwx. 1 root root 9 Nov 18 20:30 ata-SATADOM-SV_3SE_20150522AA9992050085 -> ../../sdb"
//returned string example
// "ata-SATADOM-SV_3SE_20150522AA9992050085->../../sdb"
Function start
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
TaskScheduler.prototype.start = function() {
var self = this;
return Promise.resolve()
.then(function() {
self.running = true;
Function templateApiServiceFactory
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
Promise,
workflowApiService,
taskProtocol,
eventsProtocol,
waterline,
Function workflowApiServiceFactory
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function workflowApiServiceFactory(
taskGraphProtocol,
taskGraphStore,
waterline,
TaskGraph,
- 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_version
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def parse_version(versionString):
i = 0
parsedString = ""
# Remove blank lines and spaces
- 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 runnerFactory
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
waterline,
core,
TaskScheduler,
TaskRunner,
LeaseExpirationPoller,
Function templateApiServiceFactory
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function templateApiServiceFactory(
Promise,
workflowApiService,
taskProtocol,
eventsProtocol,
- 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 buildDriveMap
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildDriveMap(wwidData, vdData, scsiData) {
var parsedWwids = parseDriveWwid(wwidData),
scsiList = parseScsiInfo(scsiData),
vdList = parseVdInfo(vdData);
var linuxWwids = parsedWwids.linuxDriveIds, esxiWwids = parsedWwids.esxiDriveIds;
Function updateTasks
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateTasks(data, timeout, retry, retries) {
var request = http.request({
hostname: server,
port: port,
Function workflowApiServiceFactory
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
taskGraphProtocol,
taskGraphStore,
waterline,
TaskGraph,
eventsProtocol,
Function handlePotentialFinishedGraph
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
CompletedTaskPoller.prototype.handlePotentialFinishedGraph = function(data) {
var self = this;
assert.object(data, 'data');
assert.string(data.state, 'data.state');
Function templatesGetByName
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
TemplateApiService.prototype.templatesGetByName = function(req, res) {
return Promise.resolve()
.then(function() {
var nodeId = req.query.nodeId;
var macs = req.query.macs;
Function getProfiles
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
ProfileApiService.prototype.getProfiles = function(req, query, res) {
var self = this;
var ipAddress = res.locals.ipAddress;
return self.getMacAddressInRequest(query, ipAddress)
.then(function(macAddress) {