Neovici/cosmoz-omnitable

View on GitHub

Showing 62 of 117 total issues

File cosmoz-omnitable-amount-range-input.js has 252 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { _ } from '@neovici/cosmoz-i18next';
import { PolymerElement } from '@polymer/polymer';
import { html } from 'lit-html';
import { ifDefined } from 'lit-html/directives/if-defined.js';
import '@neovici/cosmoz-input';
Severity: Minor
Found in lib/cosmoz-omnitable-amount-range-input.js - About 2 hrs to fix

    Function genericSorter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    export const genericSorter = (a, b) => {
        if (a === b) {
            return 0;
        }
    
    
    Severity: Minor
    Found in lib/generic-sorter.js - About 1 hr 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 layout has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        layout = (columns, container) => {
            const result = [];
    
            // eslint-disable-next-line one-var
            let [widthSum, lots] = columns.reduce(
    Severity: Minor
    Found in lib/layout.js - About 1 hr to fix

      Function useTweenArray has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          useTweenArray = (target, speedFactor = 1.9) => {
              const state = useRef({
                      request: undefined,
                      target,
                      running: false,
      Severity: Minor
      Found in lib/use-tween-array.js - About 1 hr to fix

        Function template has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            static get template() {
                return html`
                <style>
                    :host {
                        display: block;
        Severity: Minor
        Found in cosmoz-omnitable-column-list-data.js - About 1 hr to fix

          Function _getTranslations has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _getTranslations(locale) {
                  if (locale === 'sv') {
                      return {
                          Amount: 'Belopp',
                          Ascending: 'stigande',
          Severity: Minor
          Found in demo/helpers/cosmoz-translations.js - About 1 hr to fix

            Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                render() {
                    return html`
                        <style>
                            paper-dropdown-menu {
                                --iron-icon-width: 0;
            Severity: Minor
            Found in lib/cosmoz-omnitable-time-range-input.js - About 1 hr to fix

              Function mkNapi has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              const mkNapi = (host) => {
                  const /**
                       * Helper method to remove an item from `data`.
                       * @param     {Object} item Item to remove
                       * @return {Object} item removed
              Severity: Minor
              Found in lib/use-public-interface.js - About 1 hr 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 layout has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  layout = (columns, container) => {
                      const result = [];
              
                      // eslint-disable-next-line one-var
                      let [widthSum, lots] = columns.reduce(
              Severity: Minor
              Found in lib/layout.js - About 1 hr 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 current has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      setSettings((settings) => {
                          const config = settings.columns,
                              {
                                  detail: { newWidth, column },
                              } = ev,
              Severity: Minor
              Found in lib/use-resizable-columns.js - About 1 hr to fix

                Function normalizeColumns has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const normalizeColumns = (
                    columns = [],
                    settings = [],
                    savedSettings = []
                ) => {
                Severity: Minor
                Found in lib/settings/normalize.js - About 1 hr to fix

                  Function toAmount has 30 lines of code (exceeds 25 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 1 hr to fix

                    Function properties has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                static get properties() {
                                    return {
                                        /**
                                         * Used to indicate that an element using this behavior is a column definition that can be used
                                         * in cosmoz-omnitable
                    Severity: Minor
                    Found in cosmoz-omnitable-column-mixin.js - About 1 hr to fix

                      Function unique has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const unique = (values, valueProperty) => {
                              if (!Array.isArray(values)) {
                                  return;
                              }
                              const used = [];
                      Severity: Minor
                      Found in cosmoz-omnitable-column-list-mixin.js - About 1 hr to fix

                        Function ResizeNub has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            ResizeNub = host => {
                                useEffect(() => {
                                    let initial = 0,
                                        initialWidth = 0;
                                    const
                        Severity: Minor
                        Found in lib/cosmoz-omnitable-resize-nub.js - About 1 hr to fix

                          Function renderHeader has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              renderHeader(column, { filter, query }, setState, source) {
                                  return html`<cosmoz-autocomplete-ui
                                      class="external-values-${column.externalValues}"
                                      ?keep-opened=${column.keepOpened}
                                      ?keep-query=${column.keepQuery}
                          Severity: Minor
                          Found in cosmoz-omnitable-column-list.js - About 1 hr to fix

                            Function toAmount has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                toAmount = (rates = {}, value, limit, limitFunc) => { // eslint-disable-line max-statements
                                    if (value == null || value === '') {
                                        return;
                                    }
                            
                            
                            Severity: Minor
                            Found in lib/utils-amount.js - About 1 hr to fix

                              Function renderHeader has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  renderHeader(column, { filter, query }, setState, source) {
                                      return html`<cosmoz-autocomplete-ui
                                          class="external-values-${column.externalValues}"
                                          ?keep-opened=${column.keepOpened}
                                          ?keep-query=${column.keepQuery}
                              Severity: Minor
                              Found in cosmoz-omnitable-column-autocomplete.js - About 1 hr to fix

                                Function toAmount has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

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

                                Severity
                                Category
                                Status
                                Source
                                Language