Showing 204 of 440 total issues
Avoid deeply nested control flow statements. Open
if (_.includes(fwTypeKeywords, prefix)) {
FWType = prefix + '-' + element["Firmware Version"];
entry = {
"Version": element["Firmware Version"],
"node": source["node"]
Avoid deeply nested control flow statements. Open
if (typeof options.ipv4 === 'undefined') {
options.ipv4 = [];
var ip4 = {
ipaddr: ipaddress
};
Avoid deeply nested control flow statements. Open
if (typeof options.ipv4 !== "undefined") {
delete options.ipv4;
}
Avoid deeply nested control flow statements. Open
if (diskSlotFormat === 2) {
//Dell 730: Disk.Bay.1-18 = Disk.Bay.18:Enclosure.Internal.0-1:RAID.Integrated.1-1
catalogedComponentDiskSlot = parseInt(catalogedComponent.fqdd.split(".")[2].split("-")[1]);
}
Function hookApiServiceFactory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
waterline,
Logger,
_,
Errors,
assert,
Function skuPackServiceFactory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function skuPackServiceFactory(
_,
waterline,
Logger,
FileLoader,
- 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 SshFactory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function SshFactory (Promise, Serializable, encryption) {
function Ssh (defaults) {
Serializable.call(this, Ssh.schema, defaults);
}
- 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 profileApiServiceFactory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Promise,
Logger,
Errors,
_,
taskgraphService,
Consider simplifying this complex logical expression. Open
if (credentials !== undefined
&& context.request.method === "PUT"
&& context.request.originalUrl === "/api/2.0/ibms"
&& context.request.body.config !== undefined
&& context.request.body.config.user === undefined
Function staticFilesApiServiceFactory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
constants,
Logger,
Promise,
configuration,
waterline
Function schemaApiServiceFactory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
configuration,
Logger,
Promise,
_,
nodeFs
Function getSoftFwInventory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function getSoftFwInventory(options, identifier, pathsLookups, keyMatch, matchComponent) {
Function obmApiServiceFactory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
waterline,
Logger,
eventsProtocol,
Promise,
_
Function tagApiServiceFactory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
waterline,
Promise,
workflowApiService,
Errors,
_
Function _onMetadata
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var _onMetadata = function(stream, query, filename, id, metadata) {
Function templateApiServiceFactory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Promise,
Errors,
_,
taskgraphService,
crypto
Function factory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function factory(assert, _, injector, Errors, Constants) {
Function factory
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function factory(assert, _, injector, Errors, Constants) {
function FileStreamer() {
this.injectorMap = {
FileSystem: 'Files.FS'
- 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;
Avoid too many return
statements within this function. Open
return waterline.nodes.removeListItemsByIdentifier(node.id, targetsToBeRemoved)
.then(function(modifiedNode){
return self.removeRelation(modifiedNode, type);
});