Neovici/cosmoz-omnitable

View on GitHub

Showing 117 of 117 total issues

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

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

                              toDate = (value, limit, limitFunc) => { // eslint-disable-line max-statements
                                  const date = parseDate(value);
                          
                                  if (date == null) {
                                      return null;
                          Severity: Minor
                          Found in lib/utils-date.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 columnMixin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              columnMixin = (base) =>
                                  class extends base {
                                      static get properties() {
                                          return {
                                              /**
                          Severity: Minor
                          Found in cosmoz-omnitable-column-mixin.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