rx/presenters

View on GitHub

Showing 75 of 126 total issues

Function buildURL has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    buildURL(baseUrl) {
        var url = baseUrl;
        for (var i = 1; i < arguments.length; i++) {
            var args = arguments[i];
            if (Array.isArray(args)) {
Severity: Minor
Found in views/mdc/assets/js/utils/urls.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 vTimeout has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                nodeToReplace.vTimeout = setTimeout(function() {
                    httpRequest.onreadystatechange = function() {
                        if (httpRequest.readyState === XMLHttpRequest.DONE) {
                            console.debug(httpRequest.status + ':' +
                                this.getResponseHeader('content-type'));
Severity: Minor
Found in views/mdc/assets/js/components/events/replaces.js - About 1 hr to fix

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

        displayErrors(result) {
            const {statusCode, contentType, content} = result;
    
            let responseErrors = null;
    
    
    Severity: Minor
    Found in views/mdc/assets/js/components/events/errors.js - About 1 hr to fix

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

      export function initialize(root, setRoot) {
          console.debug('Initializing components');
      
          const start = performance.now();
      
      
      Severity: Minor
      Found in views/mdc/assets/js/components/initialize.js - About 1 hr to fix

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

        export function initEvents(e) {
            console.debug('\tEvents');
        
            for (const eventElem of getEventElements(e)) {
                var eventsData = JSON.parse(eventElem.dataset.events);
        Severity: Minor
        Found in views/mdc/assets/js/components/events.js - About 1 hr to fix

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

                  const promiseObj = new Promise(function(resolve) {
                      clearTimeout(elem.vTimeout);
                      elem.vTimeout = setTimeout(function() {
                          console.debug('Toggling visibility on: ' + targetId);
          
          
          Severity: Minor
          Found in views/mdc/assets/js/components/events/toggle_visibility.js - About 1 hr to fix

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

            export let visibilityObserverMixin = Base => class extends Base {
            
                recalcWhenVisible(vComponent) {
                    vComponent.hidden_on_create = vComponent.element.offsetParent === null;
                    if (vComponent.hidden_on_create) {
            Severity: Minor
            Found in views/mdc/assets/js/components/mixins/visibility-observer.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 back has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        MaterialStepper.prototype.back = function () {
                            /** @type {boolean} */
                            var moved;
                            /** @type {function} */
                            var moveStep;
            Severity: Minor
            Found in views/mdc/assets/js/mdl-stepper.js - About 1 hr to fix

              Function vTimeout has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          elem.vTimeout = setTimeout(function() {
                              console.debug('Toggling visibility on: ' + targetId);
              
                              if (action === 'show') {
                                  if (elem.vComponent && elem.vComponent.show) {
              Severity: Minor
              Found in views/mdc/assets/js/components/events/toggle_visibility.js - About 1 hr to fix

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

                                    httpRequest.onreadystatechange = function() {
                                        if (httpRequest.readyState === XMLHttpRequest.DONE) {
                                            console.debug(httpRequest.status + ':' +
                                                this.getResponseHeader('content-type'));
                                            if (httpRequest.status === 200) {
                Severity: Minor
                Found in views/mdc/assets/js/components/events/replaces.js - About 1 hr to fix

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

                  function convertLists(richtext) {
                      const tempEl = window.document.createElement('div');
                      tempEl.setAttribute('style', 'display: none;');
                      tempEl.innerHTML = richtext;
                  
                  
                  Severity: Minor
                  Found in views/mdc/assets/js/components/rich-text-area.js - About 1 hr to fix

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

                                MaterialStepper.prototype.getSteps_ = function () {
                                    /** @type {array} */
                                    var collection;
                                    /** @type {number} */
                                    var total;
                    Severity: Minor
                    Found in views/mdc/assets/js/mdl-stepper.js - About 1 hr to fix

                      Function inputs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          inputs() {
                              const components = [];
                      
                              // Collect tagged components, if applicable:
                              if (this.options.input_tag) {
                      Severity: Minor
                      Found in views/mdc/assets/js/components/events/base.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 setCustomEvents_ has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  MaterialStepper.prototype.setCustomEvents_ = function () {
                                      /** @type {function} */
                                      var linearLabels;
                                      /** @type {function} */
                                      var nonLinearLabels;
                      Severity: Minor
                      Found in views/mdc/assets/js/mdl-stepper.js - About 1 hr to fix

                        Function call has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            call(results) {
                                return new Promise((resolve) => {
                                    const elem = this.root.getElementById(this.elementId);
                                    if (!elem) {
                                        const err = new Error(
                        Severity: Minor
                        Found in views/mdc/assets/js/components/events/close_dialog.js - About 1 hr to fix

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

                              constructor(element, mdcComponent) {
                                  super(element, mdcComponent);
                          
                                  const type = element.dataset.type;
                                  const defaultConfig = {};
                          Severity: Minor
                          Found in views/mdc/assets/js/components/datetime.js - About 1 hr to fix

                            Method render_presenter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    def render_presenter(presenter)
                                      @grid_nesting = Integer(params[:grid_nesting] || 0)
                            
                                      begin
                                        before_render = Presenters::Settings.config.presenters.before_render
                            Severity: Minor
                            Found in lib/voom/presenters/web_client/app.rb - About 1 hr to fix

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

                                  inputs() {
                                      const components = [];
                              
                                      // Collect tagged components, if applicable:
                                      if (this.options.input_tag) {
                              Severity: Minor
                              Found in views/mdc/assets/js/components/events/base.js - About 1 hr to fix

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

                                    serialize(obj, prefix) {
                                        var str = [],
                                            p;
                                        for (p in obj) {
                                            if (obj.hasOwnProperty(p)) {
                                Severity: Minor
                                Found in views/mdc/assets/js/utils/urls.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 previewComponent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    previewComponent(e) {
                                        if (!this.preview) return null;
                                        for (const previewId of this.preview) {
                                            const elem = this.root.querySelector(`#${previewId}`);
                                
                                
                                Severity: Minor
                                Found in views/mdc/assets/js/components/file-inputs.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

                                Severity
                                Category
                                Status
                                Source
                                Language