Neovici/cosmoz-omnitable

View on GitHub

Showing 117 of 117 total issues

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

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

                      renderEditCell(column, { item }, onItemChange) {
                          const onChange = event => onItemChange(fromInputString(event.target.value));
                          return html`<cosmoz-input no-label-float type="text" @change=${ onChange } .value=${ getString(column, item) }></cosmoz-input>`;
                      }
                  Severity: Major
                  Found in cosmoz-omnitable-column-datetime.js and 1 other location - About 1 hr to fix
                  cosmoz-omnitable-column-date.js on lines 88..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 56.

                  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

                      renderEditCell(column, { item }, onItemChange) {
                          const onChange = event => onItemChange(fromInputString(event.target.value));
                  
                          return html`<cosmoz-input
                              no-label-float
                  Severity: Major
                  Found in cosmoz-omnitable-column-date.js and 1 other location - About 1 hr to fix
                  cosmoz-omnitable-column-datetime.js on lines 97..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 56.

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

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

                          fromHashString = value => {
                              if (value == null || value === '') {
                                  return;
                              }
                              //Parse utc from hash string
                      Severity: Major
                      Found in lib/utils-time.js and 1 other location - About 1 hr to fix
                      lib/utils-datetime.js on lines 55..61

                      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 55.

                      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

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

                          fromHashString = value => {
                              if (value == null || value === '') {
                                  return;
                              }
                              //Parse utc from hash string
                      Severity: Major
                      Found in lib/utils-datetime.js and 1 other location - About 1 hr to fix
                      lib/utils-time.js on lines 108..114

                      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 55.

                      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

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

                                  if (this.getComparableValue(min) === this.getComparableValue(filter, 'min')
                                          && this.getComparableValue(max) === this.getComparableValue(filter, 'max')
                                  ) {
                                      return;
                                  }
                      Severity: Minor
                      Found in lib/cosmoz-omnitable-range-input-mixin.js and 1 other location - About 55 mins to fix
                      lib/cosmoz-omnitable-range-input-mixin.js on lines 416..420

                      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 54.

                      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

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

                                  if (this.getComparableValue(min) === this.getComparableValue(filter, 'min')
                                          && this.getComparableValue(max) === this.getComparableValue(filter, 'max')
                                  ) {
                                      return;
                                  }
                      Severity: Minor
                      Found in lib/cosmoz-omnitable-range-input-mixin.js and 1 other location - About 55 mins to fix
                      lib/cosmoz-omnitable-range-input-mixin.js on lines 398..402

                      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 54.

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

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

                              _toInputString(value) {
                                  const date = this.toValue(value);
                                  if (date == null) {
                                      return null;
                                  }
                      Severity: Minor
                      Found in lib/cosmoz-omnitable-date-input-mixin.js and 1 other location - About 55 mins to fix
                      lib/cosmoz-omnitable-time-range-input.js on lines 73..79

                      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 53.

                      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