gtoubiana/acte

View on GitHub

Showing 31 of 31 total issues

Function balisesEtFiltres has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
Open

const balisesEtFiltres = (x, obj) => {
  let arabe;
  let ordinaux;
  let res = x;
  let chiffres = true;
Severity: Minor
Found in src/js/private/functions/balisesEtFiltres.js - About 1 day 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 saintChretien has 176 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  acte.saintChretien = (res, obj) => {
    const saints = [
      ['Sainte Marie', 'Saint Basile', 'Sainte Geneviève',
        'Saint Odilon',
        'Saint Edouard', 'Saint Mélaine', 'Saint Raymond',
Severity: Major
Found in src/docs/js/demo-script.js - About 7 hrs to fix

    File demo-script.js has 439 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Acte.js demo JS
     * http://gtoubiana.github.io/acte/
     *
     * © 2015-Present, Gilles Toubiana
    Severity: Minor
    Found in src/docs/js/demo-script.js - About 6 hrs to fix

      File spec-JourGregorien.js has 423 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      describe('new acte.Jour().gregorien()', () => {
        // Valeurs par défaut
        it(
          'new acte.Jour().gregorien() = la date grégorienne ' +
          'formatée par défaut.',
      Severity: Minor
      Found in test/spec-JourGregorien.js - About 6 hrs to fix

        Function jourRepublicain has 144 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          acte.jourRepublicain = (res, obj) => {
            const jours = [
              ['du Raisin', 'du Safran', 'de la Châtaigne', 'de la Colchique',
                'du Cheval', 'de la Balsamine', 'de la Carotte',
                'de l\'Amarante',
        Severity: Major
        Found in src/docs/js/demo-script.js - About 5 hrs to fix

          Function balisesEtFiltres has 142 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const balisesEtFiltres = (x, obj) => {
            let arabe;
            let ordinaux;
            let res = x;
            let chiffres = true;
          Severity: Major
          Found in src/js/private/functions/balisesEtFiltres.js - About 5 hrs to fix

            Function nombreEnLettres has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

            acte.nombreEnLettres = (n, r) => {
              let mill;
              let centl;
              let dixl;
              let sepunit;
            Severity: Minor
            Found in src/js/public/functions/acte.nombreEnLettres.js - About 5 hrs 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 saintChretien has 129 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            acte.saintChretien = (res, obj) => {
              const saints = [
                ['Sainte Marie', 'Saint Basile', 'Sainte Geneviève', 'Saint Odilon',
                  'Saint Edouard', 'Saint Mélaine', 'Saint Raymond', 'Saint Lucien',
                  'Sainte Alix', 'Saint Guillaume', 'Saint Paulin', 'Sainte Tatiana',
            Severity: Major
            Found in test/spec-Recettes.js - About 5 hrs to fix

              Function tabGregorien has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

              const tabGregorien = (saisie, limites) => {
                // Uniformisation de la saisie
                const iesaisie = saisie[0] === '/' ? `1${saisie}` : saisie;
                let saisieGregorien = iesaisie.replace(/\W?an\s-?([-MDCLXVI]+)\W?/gi,
              
              
              Severity: Minor
              Found in src/js/private/functions/tabGregorien.js - About 4 hrs 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 jourRepublicain has 114 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              acte.jourRepublicain = (res, obj) => {
                const jours = [
                  ['du Raisin', 'du Safran', 'de la Châtaigne', 'de la Colchique',
                    'du Cheval', 'de la Balsamine', 'de la Carotte', 'de l\'Amarante',
                    'du Panais', 'de la Cuve', 'de la Pomme de terre',
              Severity: Major
              Found in test/spec-Recettes.js - About 4 hrs to fix

                File spec-Recettes.js has 321 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                describe('Recettes', () => {
                  it(
                    'Recette 1 : Afficher l\'année sur 2 chiffres',
                    () => {
                      expect(
                Severity: Minor
                Found in test/spec-Recettes.js - About 3 hrs to fix

                  Function tabGregorien has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const tabGregorien = (saisie, limites) => {
                    // Uniformisation de la saisie
                    const iesaisie = saisie[0] === '/' ? `1${saisie}` : saisie;
                    let saisieGregorien = iesaisie.replace(/\W?an\s-?([-MDCLXVI]+)\W?/gi,
                  
                  
                  Severity: Major
                  Found in src/js/private/functions/tabGregorien.js - About 2 hrs to fix

                    Function nombreEnLettres has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    acte.nombreEnLettres = (n, r) => {
                      let mill;
                      let centl;
                      let dixl;
                      let sepunit;
                    Severity: Major
                    Found in src/js/public/functions/acte.nombreEnLettres.js - About 2 hrs to fix

                      File docs.js has 257 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /** DOCS
                       * docs.assets
                       * docs.concat.css
                       * docs.concat.js
                       * docs.constants
                      Severity: Minor
                      Found in gulp/tasks/docs.js - About 2 hrs to fix

                        Function transform has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            transform: function transform(commit) {
                              /* eslint-disable no-param-reassign,strict */
                        
                              'use strict';
                        
                        
                        Severity: Minor
                        Found in gulp/tasks/releases.js - About 1 hr to fix

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

                          const deltaT = (an) => {
                            let dt;
                            const maxindex = 1618 + (delta.length * 2);
                          
                            if ((an >= 1620) && (an < maxindex)) {
                          Severity: Minor
                          Found in src/js/private/functions/deltaT.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 tabRepublicain has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const tabRepublicain = (saisie, limites) => {
                            // On remplace les chiffres romains en chiffres arabes
                            let saisieRepublicain = saisie.replace(/\W?an\s?-?([-MDCLXVI]+)\W?/gi,
                          
                              // jscs:disable
                          Severity: Minor
                          Found in src/js/private/functions/tabRepublicain.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 tabRepublicain has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const tabRepublicain = (saisie, limites) => {
                            // On remplace les chiffres romains en chiffres arabes
                            let saisieRepublicain = saisie.replace(/\W?an\s?-?([-MDCLXVI]+)\W?/gi,
                          
                              // jscs:disable
                          Severity: Minor
                          Found in src/js/private/functions/tabRepublicain.js - About 1 hr to fix

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

                              constructor(s, limites) {
                                let tab = [];
                                let saisie = s;
                            
                                this.variables = this.variables || {};
                            Severity: Minor
                            Found in src/js/public/constructors/acte.Jour.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                if (saisieGregorien[2] && saisieGregorien[0] < 32 &&
                                  absInt(saisieGregorien[0]) !== 0 &&
                                  saisieGregorien[1] < 13 && saisieGregorien[1] > 0 &&
                                  saisieGregorien[1] !== '' && absInt(saisieGregorien[1]) !== 0 &&
                                  (saisieGregorien[0] <= joursDansLeMois[saisieGregorien[1] - 1])) {
                              Severity: Critical
                              Found in src/js/private/functions/tabGregorien.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language