edwrodrig/template_composer_webapp

View on GitHub

Showing 6 of 13 total issues

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

    set_data(data) {
        this.controls.innerHTML = "";
        for ( let automatic_method of data ) {
            let button = document.createElement('A');
            button.classList.add('nav-link');
Severity: Minor
Found in data/modules/components/remote/SectionEasyServices.js - About 1 hr to fix

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

        create_form(data, on_success) {
            let form = new Form(document.createElement('FORM'));
    
            for ( let parameter of data.parameter_list ) {
                form.dom.appendChild(this.create_input_group(parameter.name, parameter.type));
    Severity: Minor
    Found in data/modules/components/remote/SectionEasyServices.js - About 1 hr to fix

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

          add_buttons(element) {
              let control = new class extends Element {
      
                  get element_list() {
                      return this.dom.querySelectorAll('[role="tab"]');
      Severity: Minor
      Found in data/modules/components/remote/TabConnector.js - About 1 hr to fix

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

            add_contents(element) {
                let control = new class extends Element {
        
                    get element_list() {
                        let list = [];
        Severity: Minor
        Found in data/modules/components/remote/TabConnector.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 update_table has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            async update_table() {
                let table = this.table;
                table.clear();
        
                try {
        Severity: Minor
        Found in data/modules/admin/errors_screen.js - About 1 hr to fix

          Function add_buttons has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              add_buttons(element) {
                  let control = new class extends Element {
          
                      get element_list() {
                          return this.dom.querySelectorAll('[role="tab"]');
          Severity: Minor
          Found in data/modules/components/remote/TabConnector.js - About 35 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