silegis-mg/editor-articulacao

View on GitHub

Showing 67 of 86 total issues

Function processarEstado has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function processarEstado(event, _parser, _estadoParser, controller, elemento) {
Severity: Minor
Found in src/transformacaoAutomatica/transformacaoAutomatica.js - About 35 mins to fix

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

        set lexml(valor) {
            let articulacao = importarDeLexML(valor);
    
            this._elemento.innerHTML = '';
            this._elemento.appendChild(articulacao);
    Severity: Minor
    Found in src/EditorArticulacaoController.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

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

        get lexml() {
            try {
                return this.vazio ? document.createDocumentFragment() : exportarParaLexML(this._elemento, this.opcoes.rotulo);
            } catch (e) {
                if (e instanceof ArticulacaoInvalidaException) {
    Severity: Minor
    Found in src/EditorArticulacaoController.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

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

    function transformarEmLexML(json) {
        function reducaoInciso(prev, inciso, idx, array) {
    
            var idInciso = array.prefixo + "_inc" + (idx + 1);
    
    
    Severity: Minor
    Found in src/interpretadorArticulacao.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

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

    function verificarPrimeiroDoTipo(dispositivo) {
        var tipo = dispositivo.getAttribute('data-tipo');
    
        if (!tipo) {
            return null;
    Severity: Minor
    Found in src/ContextoArticulacao.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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        constructor(elemento, opcoes) {
            var container, botoes, containerBotoes, ctrl;
    
            /* Se houver suporte ao shadow-dom, então vamos usá-lo
             * para garantir o isolamento da árvore interna do componente
    Severity: Minor
    Found in src/ComponenteEdicao.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 comparar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        comparar(obj2) {
            for (let i in this.cursor) {
                if (this.cursor[i] !== obj2.cursor[i]) {
                    return true;
                }
    Severity: Minor
    Found in src/ContextoArticulacao.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