Showing 204 of 440 total issues
Function redfishApiServiceFactory
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
configuration,
Logger,
Promise,
_,
nodeFs,
Function getSelLogService
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getSelLogService = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
return redfish.getVendorNameById(identifier)
.then(function(result){
Function UPnPService
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function UPnPService(options) {
this.options = options || {};
this.options.ssdpSig = 'node.js/' + nodeVersion + ' uPnP/1.1 on-http';
this.options.ssdpTtl = 2;
this.northbound = _.filter(configuration.get('httpEndpoints', []),
Function create
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function create(fittingDef, bagpipes) {
var swaggerNodeRunner = bagpipes.config.swaggerNodeRunner;
var appRoot = swaggerNodeRunner.config.swagger.appRoot;
var serdesDirs = fittingDef.serdesDirs.map(function(dir) {
return path.resolve(appRoot, dir);
Function profileApiServiceFactory
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function profileApiServiceFactory(
Promise,
Logger,
Errors,
_,
Function createHttpProxy
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createHttpProxy(app, httpProxy){
var sep = path.sep; //The platform-specific file separator. '\\' or '/'
try {
var localPath = httpProxy.localPath || sep,
remotePath = httpProxy.remotePath || sep,
Function create
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function create(fittingDef) {
var validate = validator();
return function swagger_validator(context, next) { // jshint ignore:line
if (!context.response.headersSent) {
var schemaNameKey = fittingDef.schemaNameKey;
Function templateApiServiceFactory
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function templateApiServiceFactory(
Promise,
Errors,
_,
taskgraphService,
Function start
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
AccountApiService.prototype.start = function() {
var acl = this.acl;
var self = this;
var endpoints = configuration.get('httpEndpoints', []);
var authEnabled = _(endpoints).filter(function(endpoint) {
Function error_handler
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function error_handler(context, next) { // jshint ignore:line
if (!util.isError(context.error)) { return next(); }
var err = context.error;
var ERROR_STATUS = 400;
Function redfishApiServiceFactory
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
function redfishApiServiceFactory(
configuration,
Logger,
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 setSecureBoot
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var setSecureBoot = controller(function(req, res) {
//TODO Write logic for non racadm
var identifier = req.swagger.params.identifier.value;
var options = redfish.makeOptions(req, res, identifier);
var graphName = 'Graph.Dell.Wsman.ConfigureBios';
Function unregisterPack
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SkuPackService.prototype.unregisterPack = function(skuid, conf) {
var promises = [];
var self = this;
var skuRoot = self.confRoot + '/' + skuid;
var cleanup;
Function getFile
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FileStreamer.prototype.getFile = function(req, res, id) {
var self = this;
var uuidFound;
if (id.match(Constants.Regex.uuid)) {
Function listSystemBios
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var listSystemBios = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
return redfish.getVendorNameById(identifier)
.then(function(result) {
var node = result.node;
Function swagger_validator
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function swagger_validator(context, next) { // jshint ignore:line
if (!context.response.headersSent) {
var schemaNameKey = fittingDef.schemaNameKey;
var operation = context.request.swagger.operation;
var schemaName = operation[schemaNameKey];
Function listSystemBiosSettings
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var listSystemBiosSettings = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
return redfish.getVendorNameById(identifier)
.then(function(result){
Function listSystemEthernetInterfaces
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var listSystemEthernetInterfaces = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
return redfish.getVendorNameById(identifier)
.then(function(result){
Function getClient
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getClient() {
return Promise.try(function() {
if (consul) { return consul.agent.service.list(); }
var taskGraphUrl = url.parse(
Function SnmpFactory
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SnmpFactory (Promise, Serializable, encryption) {
function Snmp (defaults) {
Serializable.call(this, Snmp.schema, defaults);
}