Showing 151 of 386 total issues
File rest.js
has 940 lines of code (exceeds 250 allowed). Consider refactoring. Open
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
import express from 'express';
let router = express.Router();
import ws from "ws";
Function reduce
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
function reduce(result) {
for (let name in result.categories) {
if (result.categories.hasOwnProperty(name)) {
let items = result.categories[name];
if (items.length > REDUCE_LIMIT) {
- 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
File VirtualMachineAdd.js
has 469 lines of code (exceeds 250 allowed). Consider refactoring. Open
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { addMultipleVms, loadVmSizes, loadVmImages,
File generator.js
has 454 lines of code (exceeds 250 allowed). Consider refactoring. Open
// (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP
import {
addAssociation, addCategory, addResource, getItems, setSettings, setStatus
} from './data';
Function Expression
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function Expression () {
this.op = (op) => {
if (! this._op) {
this._op = op;
- 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
File DirectoryEdit.js
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { changeDirectory, loadDirectoryCertificate, trustDirectory,
File filter.js
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
// (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP
const TRACE_PARSING = false;
const TRACE_MATCHING = false;
Function _onSubmit
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
_onSubmit () {
const { directory, phase } = this.props;
const { credentials, needCredentials } = this.state;
let errors = {...this.state.errors};
let noErrors = true;
- 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 render
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { virtualMachine } = this.props;
const { chartData, graphicSize } = this.state;
const cpuData = [
Function _onSubmit
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
_onSubmit () {
let errors = { nodes: [] };
let noErrors = true;
this.state.nodes.forEach((node, index) => {
- 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
File VirtualMachineEdit.js
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { loadVmImages, loadItem, updateItem,
Function render
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { settings, setup, productName, role } = this.props;
let sessionMenu;
if (setup) {
Function start
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function start () {
const app = express();
app.use(ddos.express);
Function _renderNameFields
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderNameFields () {
const { count, naming, template, errors } = this.state;
let nameFields;
if (1 === count) {
Function alphanum
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function alphanum (a, b) {
function chunkify(t) {
var tz = [],
x = 0,
y = -1,
- 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 timer
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
let timer = setInterval(() => {
index += 1;
if (index < 10) {
setStatus({state: 'updating',
percent: Math.floor((index / 10) * 100)});
VirtualMachineAdd
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class VirtualMachineAdd extends Component {
constructor (props) {
super(props);
this._onSubmit = this._onSubmit.bind(this);
Function Expression
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Expression () {
this.op = (op) => {
if (! this._op) {
this._op = op;
Function render
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { dashboard, search } = this.props;
let tasks;
if (dashboard.tasks.count > 0) {
Function componentWillReceiveProps
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
componentWillReceiveProps (nextProps) {
var { directory, phase, response, roles } = nextProps;
if (directory.certificate && 'Connecting' === this.state.busy) {
this.setState({ busy: undefined });
} else if ('search' === phase && 'Verifying' === this.state.busy) {
- 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"