Neovici/cosmoz-omnitable

View on GitHub

Showing 113 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          renderHeader(
              { title, min, max, locale, filterStep },
              { filter },
              setState,
              source,
      Severity: Major
      Found in cosmoz-omnitable-column-time.js and 1 other location - About 4 hrs to fix
      cosmoz-omnitable-column-datetime.js on lines 103..124

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 118.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          renderHeader(
              { title,
                  min,
                  max,
                  locale,
      Severity: Major
      Found in cosmoz-omnitable-column-datetime.js and 1 other location - About 4 hrs to fix
      cosmoz-omnitable-column-time.js on lines 116..135

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 118.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export const sort = () => html`
            <sort-and-group-consumer
                class="sgs"
                .render=${({
                    columns,
        Severity: Major
        Found in lib/settings/cosmoz-omnitable-sort-group.js and 1 other location - About 3 hrs to fix
        lib/settings/cosmoz-omnitable-sort-group.js on lines 34..53

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 107.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export const group = () => html`
            <sort-and-group-consumer
                class="sgs"
                .render=${({
                    columns,
        Severity: Major
        Found in lib/settings/cosmoz-omnitable-sort-group.js and 1 other location - About 3 hrs to fix
        lib/settings/cosmoz-omnitable-sort-group.js on lines 55..74

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 107.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

                applySingleFilter = (column, filter) => item => {
                    const value = getComparableValue(column, item);
            
                    if (value == null) {
                        return false;
            Severity: Major
            Found in lib/utils-date.js and 3 other locations - About 3 hrs to fix
            lib/utils-amount.js on lines 72..84
            lib/utils-number.js on lines 100..112
            lib/utils-time.js on lines 85..97

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 99.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

                applySingleFilter = (column, filter) => item => {
                    const value = getComparableValue(column, item);
            
                    if (value == null) {
                        return false;
            Severity: Major
            Found in lib/utils-number.js and 3 other locations - About 3 hrs to fix
            lib/utils-amount.js on lines 72..84
            lib/utils-date.js on lines 197..209
            lib/utils-time.js on lines 85..97

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 99.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

                applySingleFilter = (column, filter) => item => {
                    const value = getComparableValue(column, item);
            
                    if (value == null) {
                        return false;
            Severity: Major
            Found in lib/utils-amount.js and 3 other locations - About 3 hrs to fix
            lib/utils-date.js on lines 197..209
            lib/utils-number.js on lines 100..112
            lib/utils-time.js on lines 85..97

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 99.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

                applySingleFilter = (column, filter) => item => {
                    const value = getComparableValue(column, item);
            
                    if (value == null) {
                        return false;
            Severity: Major
            Found in lib/utils-time.js and 3 other locations - About 3 hrs to fix
            lib/utils-amount.js on lines 72..84
            lib/utils-date.js on lines 197..209
            lib/utils-number.js on lines 100..112

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 99.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

                deserializeFilter(column, filter) {
                    if (filter == null || filter === '') {
                        return null;
                    }
                    const matches = filter.match(/^([^~]+)?~([^~]+)?/iu);
            Severity: Major
            Found in cosmoz-omnitable-column-date.js and 4 other locations - About 3 hrs to fix
            cosmoz-omnitable-column-amount.js on lines 84..98
            cosmoz-omnitable-column-datetime.js on lines 77..91
            cosmoz-omnitable-column-number.js on lines 82..96
            cosmoz-omnitable-column-time.js on lines 86..100

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 97.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

                deserializeFilter(column, filter) {
                    if (filter == null || filter === '') {
                        return null;
                    }
                    const matches = filter.match(/^([^~]+)?~([^~]+)?/iu);
            Severity: Major
            Found in cosmoz-omnitable-column-number.js and 4 other locations - About 3 hrs to fix
            cosmoz-omnitable-column-amount.js on lines 84..98
            cosmoz-omnitable-column-date.js on lines 68..82
            cosmoz-omnitable-column-datetime.js on lines 77..91
            cosmoz-omnitable-column-time.js on lines 86..100

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 97.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

                deserializeFilter(column, filter) {
                    if (filter == null || filter === '') {
                        return null;
                    }
                    const matches = filter.match(/^([^~]+)?~([^~]+)?/iu);
            Severity: Major
            Found in cosmoz-omnitable-column-amount.js and 4 other locations - About 3 hrs to fix
            cosmoz-omnitable-column-date.js on lines 68..82
            cosmoz-omnitable-column-datetime.js on lines 77..91
            cosmoz-omnitable-column-number.js on lines 82..96
            cosmoz-omnitable-column-time.js on lines 86..100

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 97.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language