Showing 151 of 386 total issues
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { index } = this.props;
const filter = index.filter || {};
let sortProperty, sortDirection;
Function _renderNodeFields
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderNodeFields (node, index) {
const { nodes } = this.state;
const errors = this.state.errors.nodes[index] || {};
let addressField;
Function render
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
let { activity: {item, children}, role } = this.props;
let timestamp = this._renderTimestamp(item);
let owner = this._renderOwner(item);
Function _onSubmit
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onSubmit () {
let errors = { nodes: [] };
let noErrors = true;
this.state.nodes.forEach((node, index) => {
Function render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { productName, role, software, onAction } = this.props;
let menu, details;
Function NodesSection
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NodesSection = (props) => {
const { productName, role, settings, onOpen } = props;
const nodes = settings.nodes || [];
let contents;
Function render
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { index, role } = this.props;
const { searchText } = this.state;
const result = index.result || {};
Function getItems
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function getItems (categoryName, raw) {
let result = [];
if (categoryName) {
if (Array.isArray(categoryName)) {
for (var i = 0; i < categoryName.length; i++) {
- 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 initializeSettings
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initializeSettings () {
const settings = {
description: 'These are the configuration settings for an Ingot.',
state: 'initial', // initial | updating | ready
name: 'cluster PA 4',
Function _stateFromProps
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
_stateFromProps (props, query) {
const { utilization: {result: {items}} } = props;
const areaAttribute =
(this.state && this.state.areaAttribute ? this.state.areaAttribute :
props.areaAttribute);
Function _renderForm
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderForm () {
const { hypervisor, productName, settings } = this.props;
let errors = this.state.errors;
let submitLabel = 'Connect';
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { item, includeResource } = this.props;
let icon;
if ('Active' === item.state || 'Locked' === item.state) {
Function reduce
has 46 lines of code (exceeds 25 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) {
Function HypervisorSection
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const HypervisorSection = (props) => {
const { productName, role, settings, onOpen } = props;
const hypervisor = settings.hypervisor || {};
let contents;
Function search
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function search (params, success, error) {
if (! client) {
client = ldap.createClient({
url: 'ldap://' + params.address,
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { index } = this.props;
const { filterActive, searchText, selection } = this.state;
const result = index.result || {};
Function watchNotifications
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function watchNotifications (config, preserveUris, dispatch) {
const context = config.context;
let queryText, filter;
if (context.uri || context.category || context.global) {
if (context.uri) {
Function render
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { status } = this.props;
let progress;
if (status.progress) {
Function _onSubmit
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
_onSubmit () {
let hypervisor = {...this.props.hypervisor};
if (hypervisor.address && ! hypervisor.certificate) {
this.setState({ busy: 'Connecting' });
this.props.dispatch(loadHypervisorCertificate(hypervisor));
- 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 buildItems
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function buildItems (category) {
let date = new Date();
let count = category.count || RESOURCE_COUNT;
for (var i = 1; i <= count; i++) {
- 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"