Neovici/cosmoz-omnitable

View on GitHub

Showing 62 of 117 total issues

Function listColumnMixin has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    listColumnMixin = (base) =>
        class extends base {
            static get properties() {
                return {
                    textProperty: { type: String },
Severity: Minor
Found in cosmoz-omnitable-column-list-mixin.js - About 45 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 parseDate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    parseDate = value => {
        if (value == null || value === '') {
            return;
        }

Severity: Minor
Found in lib/utils-date.js - About 45 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

Consider simplifying this complex logical expression.
Open

        if (
            !emptyLabel ||
            emptyValue === undefined ||
            !textProperty ||
            !(emptyProperty || valueProperty) ||
Severity: Major
Found in cosmoz-omnitable-column-list-mixin.js - About 40 mins to fix

    Function _valuesChanged has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        _valuesChanged(autodetect, currency, values) {
            if (!Array.isArray(values) || values.length < 1) {
                return;
            }
            if (!autodetect && currency) {
    Severity: Minor
    Found in lib/cosmoz-omnitable-amount-range-input.js - About 35 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 useList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    export const useList = ({
        host,
        error,
        dataIsValid,
        processedItems,
    Severity: Minor
    Found in lib/use-list.js - About 35 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 toAmount has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        toAmount(value, limit, limitFunc) {
            // eslint-disable-line max-statements
            if (value == null || value === '') {
                return;
            }
    Severity: Minor
    Found in lib/cosmoz-omnitable-amount-range-input.js - About 35 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

    Avoid too many return statements within this function.
    Open

            return new Date(
                getRandomInt(2014, 2017),
                getRandomInt(1, 12),
                getRandomInt(1, 28),
                getRandomInt(0, 23),
    Severity: Major
    Found in demo/table-demo-helper.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return a < b ? -1 : 1;
      Severity: Major
      Found in lib/generic-sorter.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return limitedValue === comparableDate ? date : lDate;
        Severity: Major
        Found in lib/cosmoz-omnitable-date-input-mixin.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return a - b;
          Severity: Major
          Found in lib/generic-sorter.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return lNumber === valAmount ? amount : lAmount;
            Severity: Major
            Found in lib/utils-amount.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return lNumber === valAmount ? amount : lAmount;
              Severity: Major
              Found in lib/cosmoz-omnitable-amount-range-input.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return amount;
                Severity: Major
                Found in lib/utils-amount.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return 0;
                  Severity: Major
                  Found in lib/generic-sorter.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return limitFunc(number, lNumber);
                    Severity: Major
                    Found in lib/utils-number.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return a ? -1 : 1;
                      Severity: Major
                      Found in lib/generic-sorter.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return amount;
                        Severity: Major
                        Found in lib/cosmoz-omnitable-amount-range-input.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return limitFunc(number, lNumber);
                          Severity: Major
                          Found in lib/cosmoz-omnitable-range-input-mixin.js - About 30 mins to fix

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

                            export const computeLayout = (_columnConfigs, canvasWidth, numColumns) => {
                                    const columnConfigs = _columnConfigs.filter((c) => !c.hidden),
                                        totalWidths = columnConfigs.reduce((sum, { width }) => sum + width, 0);
                            
                                    if (columnConfigs.length > 1 && totalWidths > canvasWidth) {
                            Severity: Minor
                            Found in lib/compute-layout.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 generateTableDemoData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export const generateTableDemoData = (min, max, maxRandomString) => {
                                const groupsCount = getRandomInt(min, max),
                                    data = [],
                                    descriptions = [
                                        'Lorem ipsum dolor sit amet',
                            Severity: Minor
                            Found in demo/table-demo-helper.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