Showing 173 of 964 total issues

Function BiMonthlyPeriodType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function BiMonthlyPeriodType(formatYyyyMmDd, monthNames, fnFilter) {
    this.generatePeriods = config => {
        let periods = [];
        const offset = parseInt(config.offset, 10);
        const isFilter = config.filterFuturePeriods;
Severity: Minor
Found in packages/period-selector-dialog/src/modules/FixedPeriodsGenerator.js - About 25 mins to fix

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 QuarterlyPeriodType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function QuarterlyPeriodType(formatYyyyMmDd, monthNames, fnFilter) {
    this.generatePeriods = config => {
        let periods = [];
        const offset = parseInt(config.offset, 10);
        const isFilter = config.filterFuturePeriods;
Severity: Minor
Found in packages/period-selector-dialog/src/modules/FixedPeriodsGenerator.js - About 25 mins to fix

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 YearlyPeriodType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function YearlyPeriodType(formatYyyyMmDd, fnFilter) {
    this.generatePeriods = config => {
        let periods = [];
        const offset = parseInt(config.offset, 10);
        const isFilter = config.filterFuturePeriods;
Severity: Minor
Found in packages/period-selector-dialog/src/modules/FixedPeriodsGenerator.js - About 25 mins to fix

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 isCloseDisabled has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function isCloseDisabled(isValid) {
    const model = legendItemStore.getState() && legendItemStore.getState().model;

    if (model && (model.startValue === undefined || model.endValue === undefined || model.name === undefined)) {
        return true;
Severity: Minor
Found in packages/legend/src/EditLegendItem.component.js - About 25 mins to fix

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 ActionButtonContainer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const ActionButtonContainer = ({ 
    classes, 
    isFocused,
    interpretationId,
    currentUserLikesInterpretation,
Severity: Minor
Found in packages/interpretations/src/components/Buttons/ActionButtonContainer.js - About 25 mins to fix

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 6 (exceeds 5 allowed). Consider refactoring.
Open

    render() {
        const itemsPerRow = this.props.rowItemCount;
        const menuWidth = itemsPerRow * MENU_ITEM_WIDTH;
        const { name, children } = this.props;
        const menuStyle = Object.assign({}, styles.dropDownWrap, {
Severity: Minor
Found in packages/header-bar/src/menus/HeaderMenu.js - About 25 mins to fix

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 updateFieldState has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    updateFieldState(state, fieldName, fieldState) {
        const fieldProp = this.getFieldProp(fieldName);
        state.fields[fieldName] = {
            pristine: fieldState.pristine !== undefined
                ? !!fieldState.pristine
Severity: Minor
Found in packages/forms/src/FormBuilder.component.js - About 25 mins to fix

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 FinancialAprilPeriodType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function FinancialAprilPeriodType(formatYyyyMmDd, monthNames, fnFilter) {
    this.generatePeriods = config => {
        let periods = [];
        const offset = parseInt(config.offset, 10);
        const isFilter = config.filterFuturePeriods;
Severity: Minor
Found in packages/period-selector-dialog/src/modules/FixedPeriodsGenerator.js - About 25 mins to fix

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 save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    async save(d2) {
        const modelId = this._parent.id;
        const modelName = this._parent.modelDefinition.name;
        const isNewInterpretation = !this.id;

Severity: Minor
Found in packages/interpretations/src/models/interpretation.js - About 25 mins to fix

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 userCanManage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const userCanManage = (d2, object) => {
    const { currentUser } = d2 || {};

    if (!object || !object.user || !currentUser) {
        return false;
Severity: Minor
Found in packages/interpretations/src/authorization/auth.js - About 25 mins to fix

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 SvgIcon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const SvgIcon = ({ icon, children, className, disabled, style }) => {
    let Icon = null;
    if (children && !icons[icon]) {
        Icon = MUISvgIcon;
    } else {
Severity: Minor
Found in packages/core/src/svg-icon/SvgIcon.js - About 25 mins to fix

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 TwoPanelSelector has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function TwoPanelSelector(props) {
    const { children, childWrapStyle, mainStyle, sizeRatio, ...otherProps } = props;
    const mergedMainStyle = {
        flex: 1,
        display: 'flex',
Severity: Minor
Found in packages/core/src/layout/TwoPanel.component.js - About 25 mins to fix

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 6 (exceeds 5 allowed). Consider refactoring.
Open

    render() {
        const styles = {
            tree: {
                marginLeft: 16,
                whiteSpace: 'nowrap',
Severity: Minor
Found in packages/core/src/tree-view/TreeView.component.js - About 25 mins to fix

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

Severity
Category
Status
Source
Language