Showing 151 of 386 total issues
Function _buildLocationSearch
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function _buildLocationSearch (query, filter, sort) {
let result = '';
if (query && query.toString().length > 0) {
result += (result.length === 0 ? '?' : '&');
result += `q=${encodeURIComponent(query.toString())}`;
- 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 TextTerm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function TextTerm (text) {
this._not = false;
this._text = text;
// if the string is quoted, require matching at both ends
- 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 AttributeTerm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function AttributeTerm (text) {
this._not = false;
const parts = text.toLowerCase().split(':');
this._name = parts[0];
- 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 componentWillReceiveProps
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
componentWillReceiveProps (nextProps) {
// if any uploads have finished, refresh to pick up notifications
for (let i=0; i<nextProps.uploads.length; i++) {
let upload = nextProps.uploads[i];
if ('Uploaded' === upload.state) {
- 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 watchTask
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function watchTask (uri, progressHandler) {
const promise = new Promise((resolve, reject) => {
const check = () => {
getItem(uri)
.then(task => {
- 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { item, index, onlyActiveStatus, includeResource } = this.props;
let separator;
if (0 === 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
Function layout
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
layout () {
const { container } = this.state;
if (container) {
let rect = container.getBoundingClientRect();
let children = container.childNodes;
- 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 buildParams
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildParams (config, query, filter, sort) {
let result = {
category: config.category,
count: pageSize,
start: 0
Function _onSubmit
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onSubmit (event) {
event.preventDefault();
const { router } = this.context;
const { count, template } = this.state;
let errors = {};
Function addUtilization
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function addUtilization (item) {
// If the item came from the generator, copy attributes so each item has
// its own
let attributes = item.attributes || {};
if (item._indexAttributes) {
Function respondToRequest
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function respondToRequest (connection, request) {
let response = {op: 'update', id: request.id};
try {
if ('/rest/index/resources' === request.uri) {
Function buildItems
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildItems (category) {
let date = new Date();
let count = category.count || RESOURCE_COUNT;
for (var i = 1; i <= count; i++) {
Function _renderForm
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderForm () {
const { phase } = this.props;
let summary;
let contents;
Function _renderSections
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderSections (sortProperty, sortDirection) {
const { index } = this.props;
const result = index.result || { items: [] };
const items = (result.items || []).slice(0);
let sections = [];
Function buildItem
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildItem (options) { //categoryName, index, name, date) {
const category = options.category;
const resource = {
name: options.name,
Function series
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const series = items.map((item, index) => {
const areaValue = item[areaAttribute] ||
item.attributes[areaAttribute] || 0;
const colorValue = item[colorAttribute] ||
item.attributes[colorAttribute] || 0;
Function _renderNetworkFields
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderNetworkFields () {
const { virtualMachine } = this.state;
const networks = (virtualMachine.networks || []).map((network, index) => {
return (
<ListItem key={index} justify="between" pad="none"
Function _renderNetworkFields
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderNetworkFields () {
const { template } = this.state;
const networks = template.networks.map((network, index) => {
return (
<ListItem key={index} justify="between" pad="none"
Function _stateFromProps
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_stateFromProps (props, query) {
const { utilization: {result: {items}} } = props;
const areaAttribute =
(this.state && this.state.areaAttribute ? this.state.areaAttribute :
props.areaAttribute);
- 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 _onSubmit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_onSubmit (event) {
event.preventDefault();
const { router } = this.context;
const { count, template } = this.state;
let errors = {};
- 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"