Showing 204 of 440 total issues
Function wsmanServiceFactory
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function wsmanServiceFactory(
waterline,
encryption,
configuration,
WsmanTool,
File obm-api-service.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Copyright 2016, EMC, Inc.
'use strict';
var di = require('di');
Function installPack
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SkuPackService.prototype.installPack = function(fromRoot, skuid) {
var self = this;
var contents;
return fs.readFileAsync(fromRoot + '/config.json')
.then(function(fileContents) {
Function postNode
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NodeApiService.prototype.postNode = function(body) {
var nodeBody = _.omit(body, ['obms', 'ibms']);
var obmBody = body.obms || body.obmSettings || null;
var ibmBody = body.ibms || null;
Function getDrive
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getDrive = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
var index = req.swagger.params.index.value;
var driveIndex = req.swagger.params.driveIndex.value;
Function addHotspare
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var addHotspare = controller(function(req,res) {
var identifier = req.swagger.params.identifier.value;
var driveIndex = req.swagger.params.driveIndex.value;
var payload = req.swagger.params.payload.value;
/*
Function getSerialNumber
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getSerialNumber(amqpMessage) {
//amqpMessage.data.originOfCondition = "Disk.Bay.1-0";
if (amqpMessage.data.OriginOfCondition !== null && amqpMessage.data.OriginOfCondition !== undefined) {
var diskType;
var splitAlertName = amqpMessage.data.OriginOfCondition.split(".");
Function listStorage
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var listStorage = controller(function (req, res) {
var identifier = req.swagger.params.identifier.value;
return redfish.getVendorNameById(identifier)
.then(function (result) {
identifier = result.node.id;
Function addRelation
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NodeApiService.prototype.addRelation = function addRelation(node, type, targets) {
if (!(node && type && targets)) {
return;
}
return waterline.nodes.addFieldIfNotExistByIdentifier(node.id, "relations", [])
Function _render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _render(viewName, req, res) {
var options;
return Promise.try(function() {
assert.optionalString(viewName);
Function getNetwork
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getNetwork = controller(function(req, res) {
//var redfishId = redfish.isRedfish(req.swagger.params.identifier.value);
var identifier = req.swagger.params.identifier.value;
return redfish.getVendorNameById(identifier)
Function skuPackHandler
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SkuPackService.prototype.skuPackHandler = function(req,res,skuid) {
var self = this;
var name = uuid('v4');
var tmpDir = tmp();
Function getSystem
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getSystem = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
return redfish.getVendorNameById(identifier)
.then(function(result){
var node = result.node;
Function obmApiServiceFactory
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
function obmApiServiceFactory(
waterline,
Logger,
eventsProtocol,
Promise,
- 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 deleteVolume
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var deleteVolume = controller(function(req,res) {
var identifier = req.swagger.params.identifier.value;
var volumeIndex = req.swagger.params.volumeIndex.value;
var payload = req.swagger.params.payload.value;
var graphName = 'Graph.Dell.Wsman.Delete.Volume';
Function _setup
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
HttpService.prototype._setup = function() {
var app = this.app;
var endpoint = this.endpoint;
// CORS Support
Function getSystemProcessor
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getSystemProcessor = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
return redfish.getVendorNameById(identifier)
.then(function(result) {
Function removeNode
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NodeApiService.prototype.removeNode = function(node, srcType) {
var self = this;
return self._delValidityCheck(node.id)
.then(function () {
if (!node.hasOwnProperty('relations')) {
Function resetSystemBios
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var resetSystemBios = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
var options = redfish.makeOptions(req, res, identifier);
var payload = req.swagger.params.payload.value;
Function dataFactory
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var dataFactory = function(identifier, dataName) {
switch(dataName) {
case 'catData':
return Promise.all([nodeApi.getNodeCatalogSourceById(identifier,'ohai'), nodeApi.getNodeCatalogSourceById(identifier,'dmi')])
.spread(function(ohai, dmi) {