rx/presenters

View on GitHub

Showing 126 of 126 total issues

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

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

            constructor(options, params, event, root) {
              this.targetId = options.target;
              this.params = params;
              this.event = event;
              this.root = root;
          Severity: Major
          Found in views/mdc/assets/js/components/events/toggle_disabled.js and 2 other locations - About 1 hr to fix
          views/mdc/assets/js/components/events/dialog.js on lines 2..7
          views/mdc/assets/js/components/events/toggle_visibility.js on lines 2..7

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

          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 3 locations. Consider refactoring.
          Open

              constructor(options, params, event, root) {
                  this.targetId = options.target;
                  this.params = params;
                  this.event = event;
                  this.root = root;
          Severity: Major
          Found in views/mdc/assets/js/components/events/toggle_visibility.js and 2 other locations - About 1 hr to fix
          views/mdc/assets/js/components/events/dialog.js on lines 2..7
          views/mdc/assets/js/components/events/toggle_disabled.js on lines 2..7

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

          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

                          else if (action === 'hide') {
                              if (elem.vComponent && elem.vComponent.hide) {
                                  elem.vComponent.hide();
                              }
                              else {
          Severity: Major
          Found in views/mdc/assets/js/components/events/toggle_visibility.js and 1 other location - About 1 hr to fix
          views/mdc/assets/js/components/events/toggle_visibility.js on lines 35..58

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

          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

                          if (action === 'show') {
                              if (elem.vComponent && elem.vComponent.show) {
                                  elem.vComponent.show();
                              }
                              else {
          Severity: Major
          Found in views/mdc/assets/js/components/events/toggle_visibility.js and 1 other location - About 1 hr to fix
          views/mdc/assets/js/components/events/toggle_visibility.js on lines 43..58

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

          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 3 locations. Consider refactoring.
          Open

              constructor(options, params, event, root) {
                  this.dialogId = options.target;
                  this.params = params;
                  this.event = event;
                  this.root = root;
          Severity: Major
          Found in views/mdc/assets/js/components/events/dialog.js and 2 other locations - About 1 hr to fix
          views/mdc/assets/js/components/events/toggle_disabled.js on lines 2..7
          views/mdc/assets/js/components/events/toggle_visibility.js on lines 2..7

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

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

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

              test('has returns false for an absent key', () => {
                  expect(appConfig.has('absent')).toEqual(false);
                  expect(appConfig.has('absent.key')).toEqual(false);
              });
              Severity: Major
              Found in views/mdc/assets/js/utils/config.test.js and 1 other location - About 1 hr to fix
              views/mdc/assets/js/utils/config.test.js on lines 56..59

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

              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

              test('has handles nested keys', () => {
                  expect(appConfig.has('aaa.bbb.ggg')).toEqual(true);
                  expect(appConfig.has('aaa.bbb.absent')).toEqual(false);
              });
              Severity: Major
              Found in views/mdc/assets/js/utils/config.test.js and 1 other location - About 1 hr to fix
              views/mdc/assets/js/utils/config.test.js on lines 51..54

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

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

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

                        onShow() {
                            if (this.element.vPlugin && this.element.vPlugin.onShow) {
                                return this.element.vPlugin.onShow();
                            }
                        }
                    Severity: Major
                    Found in views/mdc/assets/js/components/plugins.js and 2 other locations - About 1 hr to fix
                    views/mdc/assets/js/components/plugins.js on lines 48..52
                    views/mdc/assets/js/components/plugins.js on lines 54..58

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

                    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 3 locations. Consider refactoring.
                    Open

                        reset() {
                            if (this.element.vPlugin && this.element.vPlugin.reset) {
                                return this.element.vPlugin.reset();
                            }
                        }
                    Severity: Major
                    Found in views/mdc/assets/js/components/plugins.js and 2 other locations - About 1 hr to fix
                    views/mdc/assets/js/components/plugins.js on lines 48..52
                    views/mdc/assets/js/components/plugins.js on lines 60..64

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

                    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

                        actionsFinished(vEvent) {
                            const ev = new CustomEvent('V:actionsFinished', {
                                bubbles: true,
                                cancelable: false,
                                detail: vEvent,
                    Severity: Major
                    Found in views/mdc/assets/js/components/base-component.js and 1 other location - About 1 hr to fix
                    views/mdc/assets/js/components/base-component.js on lines 68..76

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

                    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