Showing 100 of 247 total issues
Function swaggerSerializer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function swaggerSerializer(injectableSerializer) {
var Serializer = injector.get(injectableSerializer);
function serialize(data) {
var serializer = new Serializer();
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
Function Runner
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function Runner(configureFile, Logger, uuid, constants,
eventsProtocol, lookupService, Errors, events) {
Function convert_raid_to_jbod
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def convert_raid_to_jbod():
"""
To delete RAID and create JBOD for each physical disk of a virtual disk with RAID
:rtype : list
:return: a string includes all the disks to be erased
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
eventsProtocol,
Logger,
waterline,
Errors,
Promise,
Function ServiceGraph
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function ServiceGraph(TaskGraph, store, taskGraphProtocol, Constants, Promise, _) {
Function loaderFactory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function loaderFactory(store, taskLibrary, Logger, assert, Promise, _) {
Function executeTasks
has a Cognitive Complexity of 8 (exceeds 5 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;
- 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 leaseExpirationPollerFactory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
store,
Logger,
assert,
Constants,
Rx,
Function taskRunnerFactory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function taskRunnerFactory(
Logger,
Promise,
graphProgressService,
Constants,
- 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 schemaApiServiceFactory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
configuration,
Logger,
Promise,
_,
nodeFs
Function mark_on_disk
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def mark_on_disk(disk_name, log, flag, back_skip, mark_files):
Function handleExecResult
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var handleExecResult = function(_task, _done, error, stdout, stderr) {
Function __get_hdparm_duration
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __get_hdparm_duration(self, log):
"""
Get hdparm required secure erase time.
:param log: a file object of secure erase log
:return: required secure erase time indicated by hdparm tool
- 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 taskApiServiceFactory
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function taskApiServiceFactory(
taskProtocol,
waterline,
Errors,
util,
- 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 __sg_requests_parser
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __sg_requests_parser(self, drive):
"""
Secure erase job progress parser for sg_format and sg_sanitize tools.
:param drive: drive name
:return: a float digital of percentage
- 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 getSataNameStr
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getSataNameStr(sataDrive) {
var output = execSync(cmdSataRawInfo + ' /dev/' + sataDrive);
/* output data like below:
* $ sudo hdparm --Istdout /dev/sda
* dev/sda:
- 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
return undefined;
Function get_disk_size
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_disk_size(disk_name, log, mark_files):
"""
Get disk size and create empty mark files
:param disk_name: disk name that be copied data to.
:param log: an opened file object to store stdout and stderr
- 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 mark_on_disk
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mark_on_disk(disk_name, log, flag, back_skip, mark_files):
"""
Copy 512 Bytes random data to specified disk address as a mark.
Or to read the marks from disk for verification
:param disk_name: disk name that be copied data to.
- 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"