lifegadget/ui-list

View on GitHub

Showing 9 of 916 total issues

File ember.d.ts has 910 lines of code (exceeds 250 allowed). Consider refactoring.
Open

interface DOMElement {}
interface Promise<T> {}
declare class Registry {}
declare class Transition {}
declare namespace Handlebars { class SafeString {} }
Severity: Major
Found in typings/ember/ember.d.ts - About 2 days to fix

    Function onClick has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        onClick(options) {
          const {min,max,_selected,selectionProperty} = this.getProperties('min','max','_selected','selectionProperty');
          const item = options.item;
          const itemId = item.get(selectionProperty);
          const itemSelected = item.get('selected');
    Severity: Major
    Found in addon/components/ui-selectable-list.js - About 2 hrs to fix

      Function _columns has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _columns: computed('attrs.columns','columns.isFulfilled', function() {
          let columns = this.get('columns'); // column definition
          const defaultConfig = {
            type: 'string',
            horizontal: 'left',
      Severity: Minor
      Found in addon/components/ui-row-item.js - About 1 hr to fix

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

          _value: computed('value', function() {
            const {precision,type,format,empty,_isEmpty} = this.getProperties('precision', 'type', 'format','empty','_isEmpty');
            let value = this.get('value');
            if(_isEmpty && empty) {
              return empty;
        Severity: Minor
        Found in addon/components/ui-cell-aspect.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 _value has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _value: computed('value', function() {
            const {precision,type,format,empty,_isEmpty} = this.getProperties('precision', 'type', 'format','empty','_isEmpty');
            let value = this.get('value');
            if(_isEmpty && empty) {
              return empty;
        Severity: Minor
        Found in addon/components/ui-cell-aspect.js - About 1 hr to fix

          Function onClick has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              onClick(options) {
                const {min,max,_selected,selectionProperty} = this.getProperties('min','max','_selected','selectionProperty');
                const item = options.item;
                const itemId = item.get(selectionProperty);
                const itemSelected = item.get('selected');
          Severity: Minor
          Found in addon/components/ui-selectable-list.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 commit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              commit() {
                let items = this.get('sortedItems');
                let groupModel = this.get('_registry').map(item=>item.child);
                let itemModels = items.mapBy('data');
                let draggedItem = items.findBy('wasDropped', true);
          Severity: Minor
          Found in addon/mixins/sortable-list.js - About 1 hr to fix

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

              _tellAncestors(msg, options={}) {
                const parent = this._getParent();
                const response = this.get('_hasMessagingParent') ? parent._message(msg,options) : false;
                options = typeOf(options)==='object' ? merge(options,response) : options;
                if(isPresent(options.curriedBy)) {
            Severity: Minor
            Found in addon/mixins/node-messenger.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 _filter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              _filter: computed('filter', function() {
                const filter = this.get('filter');
                switch(typeOf(filter)) {
                  case 'object':
                    if(!filter.key || !filter.value) {
            Severity: Minor
            Found in addon/components/ui-list.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