Neovici/cosmoz-omnitable

View on GitHub

Showing 62 of 113 total issues

Function rangeInputMixin has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
Open

export const rangeInputMixin = base => // eslint-disable-line max-lines-per-function
    /**
     * @polymer
     * @mixinClass
     */
Severity: Minor
Found in lib/cosmoz-omnitable-range-input-mixin.js - About 1 day 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 template has 220 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static get template() {
        return html`
            <style>
                :host {
                    display: block;
Severity: Major
Found in demo/helpers/x-page.js - About 1 day to fix

    File cosmoz-omnitable-styles.js has 465 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable max-lines */
    import { tagged as css } from '@neovici/cosmoz-utils';
    const checkbox = css`
        .checkbox {
            box-sizing: border-box;
    Severity: Minor
    Found in cosmoz-omnitable-styles.js - About 7 hrs to fix

      Function dateInputMixin has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

      export const dateInputMixin = base => // eslint-disable-line max-lines-per-function
          /**
           * @polymer
           * @mixinClass
           */
      Severity: Minor
      Found in lib/cosmoz-omnitable-date-input-mixin.js - About 4 hrs 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 useProcessedItems has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      export const useProcessedItems = ({
          data,
          columns,
          hashParam,
          sortAndGroupOptions,
      Severity: Minor
      Found in lib/use-processed-items.js - About 3 hrs 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

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

      /* eslint-disable max-lines */
      import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js';
      import { timeOut } from '@polymer/polymer/lib/utils/async.js';
      import { enqueueDebouncer } from '@polymer/polymer/lib/utils/flush.js';
      
      
      Severity: Minor
      Found in lib/cosmoz-omnitable-range-input-mixin.js - About 3 hrs to fix

        Function useResizableColumns has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

        export const useResizableColumns = ({
            host,
            canvasWidth,
            layout,
            setSettings,
        Severity: Minor
        Found in lib/use-resizable-columns.js - About 3 hrs 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

        File x-page.js has 309 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import '@polymer/paper-dropdown-menu/paper-dropdown-menu-light';
        import '@polymer/iron-icons/editor-icons';
        import '@polymer/iron-icons/iron-icons';
        import '@polymer/paper-button/paper-button';
        import '@polymer/paper-toggle-button/paper-toggle-button';
        Severity: Minor
        Found in demo/helpers/x-page.js - About 3 hrs to fix

          Function useOmnitable has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const useOmnitable = (host) => {
              const {
                      hashParam,
                      settingsId,
                      data,
          Severity: Major
          Found in lib/use-omnitable.js - About 3 hrs to fix

            Function SettingsUI has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                SettingsUI = (host) => {
                    const {
                        settings,
                        settingsId,
                        onSave,
            Severity: Major
            Found in lib/settings/cosmoz-omnitable-settings.js - About 2 hrs to fix

              Function processedItems has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      processedItems = useMemo(() => {
                          if (
                              !noLocalSort &&
                              !groupOnColumn &&
                              sortOnColumn != null &&
              Severity: Major
              Found in lib/use-processed-items.js - About 2 hrs to fix

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

                    render() {
                        const onOpenedChanged = (event) => {
                            this.headerFocused = event.detail.value;
                            this._onDropdownOpenedChanged(event);
                        };
                Severity: Major
                Found in lib/cosmoz-omnitable-amount-range-input.js - About 2 hrs to fix

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

                          static get properties() { // eslint-disable-line max-lines-per-function
                              return {
                                  filter: {
                                      type: Object,
                                      notify: true
                  Severity: Major
                  Found in lib/cosmoz-omnitable-range-input-mixin.js - About 2 hrs to fix

                    Function useSortAndGroupOptions has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const useSortAndGroupOptions = (
                            columns,
                            hashParam,
                            settings,
                            setSettings,
                    Severity: Major
                    Found in lib/use-sort-and-group-options.js - About 2 hrs to fix

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

                          render() {
                              const onOpenedChanged = (event) => {
                                  this.headerFocused = event.detail.value;
                                  this._onDropdownOpenedChanged(event);
                              };
                      Severity: Major
                      Found in lib/cosmoz-omnitable-number-range-input.js - About 2 hrs to fix

                        Function generateTableDemoData has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const generateTableDemoData = (min, max, maxRandomString) => {
                            const groupsCount = getRandomInt(min, max),
                                data = [],
                                descriptions = [
                                    'Lorem ipsum dolor sit amet',
                        Severity: Major
                        Found in demo/table-demo-helper.js - About 2 hrs to fix

                          Function mkNapi has 54 lines of code (exceeds 25 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: Major
                          Found in lib/use-public-interface.js - About 2 hrs to fix

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

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

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

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

                                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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language