Showing 100 of 247 total issues
Function getTasks
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getTasks(timeout) {
http.request({
hostname: server,
port: port,
path: tasksPath,
Function swaggerController
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function swaggerController(options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
Function validate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
SchemaApiService.prototype.validate = function(obj, schemaName) {
return Promise.resolve().then(function() {
var basename;
// If a schemaName is specified, then validate against that
Function parse_snmp_host
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def parse_snmp_host(snmpString):
i = 0
parsedString = ""
# Replace multiple spaces with a new line
- 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 taskRunnerFactory
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Logger,
Promise,
graphProgressService,
Constants,
assert,
Function run
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function run(done) {
var wwidData, vdData, scsiData;
try {
exec(cmdDriveWwid, options, function (err0, stdout0) {
if (err0) {
Function failGraph
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
TaskScheduler.prototype.failGraph = function(data, graphState) {
var self = this;
var graphToBePublished;
return Rx.Observable.just(data.graphId)
.flatMap(store.getActiveGraphById)
Function getSwitchDiscoveryConfiguration
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
ProfileApiService.prototype.getSwitchDiscoveryConfiguration = function(node, vendor) {
var configuration = {
name: 'Graph.SKU.Switch.Discovery.Active',
options: {
defaults: {
Function start
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function start() {
var app = require('express')();
var http = require('http');
var swaggerTools = require('swagger-tools');
var rewriter = require('express-urlrewrite');
Function load
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Loader.prototype.load = function() {
var self = this;
return Promise.all([
store.getTaskDefinitions(),
Function completedTaskPollerFactory
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function completedTaskPollerFactory(
store,
graphProgressService,
eventsProtocol,
Logger,
- 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 eachSeries
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function eachSeries(arr, iterator, callback) {
callback = callback || function () {};
if (!arr.length) {
return callback();
- 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 start
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Runner.prototype.start = function(options) {
var self = this;
return core.start()
// Remove profiles and templates from db to force reload and update file
Function subscribeCancelGraph
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
TaskScheduler.prototype.subscribeCancelGraph = function() {
var self = this;
return taskMessenger.subscribeCancelGraph(
function(data) {
var resolve;
Function publishTaskProgress
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
NotificationApiService.prototype.publishTaskProgress = function(message) {
var progressData;
return Promise.try(function() {
message.value = parseInt(message.value);
message.maximum = parseInt(message.maximum);
Function completedTaskPollerFactory
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
store,
graphProgressService,
eventsProtocol,
Logger,
assert,
Function taskApiServiceFactory
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
taskProtocol,
waterline,
Errors,
util,
configuration,
Function Runner
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function Runner(configureFile, Logger, uuid, constants,
eventsProtocol, lookupService, Errors, events) {
var logger = Logger.initialize('TaskGraph');
var server;
function start() {
- 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 NotificationApiServiceFactory
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function NotificationApiServiceFactory(
eventsProtocol,
Logger,
waterline,
Errors,
- 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 initializePipeline
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
TaskScheduler.prototype.initializePipeline = function() {
/*
* Before setting up the stream, make sure it is running, otherwise
* this will create a stream that will never run and immediately complete.
* This is basically defensive programming to try to prevent accidents where the