elabftw/elabftw

View on GitHub

Showing 221 of 356 total issues

File de_DE.js has 419 lines of code (exceeds 250 allowed). Consider refactoring.
Open

tinymce.addI18n('de_DE',{
"Redo": "Wiederholen",
"Undo": "R\u00fcckg\u00e4ngig machen",
"Cut": "Ausschneiden",
"Copy": "Kopieren",
Severity: Minor
Found in src/js/tinymce-langs/de_DE.js - About 6 hrs to fix

    File pl_PL.js has 419 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    tinymce.addI18n('pl_PL',{
    "Redo": "Powt\u00f3rz",
    "Undo": "Cofnij",
    "Cut": "Wytnij",
    "Copy": "Kopiuj",
    Severity: Minor
    Found in src/js/tinymce-langs/pl_PL.js - About 6 hrs to fix

      File sk_SK.js has 418 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      tinymce.addI18n('sk_SK',{
      "Redo": "Znova",
      "Undo": "Sp\u00e4\u0165",
      "Cut": "Vystrihn\u00fa\u0165",
      "Copy": "Kop\u00edrova\u0165",
      Severity: Minor
      Found in src/js/tinymce-langs/sk_SK.js - About 6 hrs to fix

        File QueryBuilderVisitor.php has 401 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * @author Nicolas CARPi <nico-git@deltablot.email>
         * @author Marcel Bolten <github@marcelbolten.de>
        Severity: Minor
        Found in src/services/advancedSearchQuery/visitors/QueryBuilderVisitor.php - About 5 hrs to fix

          File sl_SI.js has 400 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          tinymce.addI18n('sl_SI',{
          "Redo": "Ponovno uveljavi",
          "Undo": "Razveljavi",
          "Cut": "Izre\u017ei",
          "Copy": "Kopiraj",
          Severity: Minor
          Found in src/js/tinymce-langs/sl_SI.js - About 5 hrs to fix

            Function getCan has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getCan(array $can): bool
                {
                    // if base permission is public, we can
                    if ($can['base'] === BasePermissions::Full->value) {
                        return true;
            Severity: Minor
            Found in src/classes/Permissions.php - 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 generateInput has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

              generateInput(name: string, properties: ExtraFieldProperties): Element {
                // we don't know yet which kind of element it will be
                let element: HTMLInputElement|HTMLSelectElement;
                // generate a unique id for the element so we can associate the label properly
                const uniqid = this.getRandomId();
            Severity: Minor
            Found in src/ts/Metadata.class.ts - 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

            Method create has 130 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function create(): bool
                {
                    $schema = Update::getRequiredSchema();
            
                    $sql = "INSERT INTO `config` (`conf_name`, `conf_value`) VALUES
            Severity: Major
            Found in src/models/Config.php - About 5 hrs to fix

              Function exports has 127 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = (env) => {
                return {
                  entry: {
                    main: [
                      './src/scss/main.scss',
              Severity: Major
              Found in builder.js - About 5 hrs to fix

                Function generateInput has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  generateInput(name: string, properties: ExtraFieldProperties): Element {
                    // we don't know yet which kind of element it will be
                    let element: HTMLInputElement|HTMLSelectElement;
                    // generate a unique id for the element so we can associate the label properly
                    const uniqid = this.getRandomId();
                Severity: Major
                Found in src/ts/Metadata.class.ts - About 4 hrs to fix

                  Function execute has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function execute(InputInterface $input, OutputInterface $output): int
                      {
                          $Db = Db::getConnection();
                  
                          $queryItemsOrExperiment = "SELECT DISTINCT `id`, `body`, `userid`
                  Severity: Minor
                  Found in src/commands/AddMissingLinks.php - 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 getTinymceBaseConfig has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function getTinymceBaseConfig(page: string): object {
                    let plugins = 'accordion advlist anchor autolink autoresize table searchreplace code fullscreen insertdatetime charmap lists save image link pagebreak codesample template mention visualblocks visualchars emoticons';
                    let toolbar1 = 'undo redo | styles fontsize bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | superscript subscript | bullist numlist outdent indent | forecolor backcolor | charmap emoticons adddate | codesample | link | sort-table | save';
                    let removedMenuItems = 'newdocument, image, anchor';
                    if (page === 'edit') {
                  Severity: Minor
                  Found in src/ts/tinymce.ts - 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

                  Method generate has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function generate(Experiments | Items $Entity): void
                      {
                          $Teams = new Teams($Entity->Users, $Entity->Users->team);
                          $Teams->bypassWritePermission = true;
                          if ($Entity instanceof Experiments) {
                  Severity: Major
                  Found in src/services/Populate.php - About 4 hrs to fix

                    Method importRootDataset has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function importRootDataset(array $dataset): void
                        {
                            $createTarget = $this->targetNumber;
                            $title = $this->transformIfNecessary($dataset['name'] ?? _('Untitled'));
                    
                    
                    Severity: Major
                    Found in src/Import/Eln.php - About 4 hrs to fix

                      Function formatMetadata has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function formatMetadata(string $json): string
                          {
                              $final = '';
                              $Metadata = new Metadata($json);
                              $extraFields = $Metadata->getExtraFields();
                      Severity: Minor
                      Found in src/classes/TwigFilters.php - About 3 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

                      File edit.ts has 329 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /**
                       * @author Nicolas CARPi <nico-git@deltablot.email>
                       * @copyright 2012 Nicolas CARPi
                       * @see https://www.elabftw.net Official website
                       * @license AGPL-3.0
                      Severity: Minor
                      Found in src/ts/edit.ts - About 3 hrs to fix

                        Method getSettingsByIdp has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function getSettingsByIdp(array $idp): array
                            {
                                $idpSigningCerts = array($idp['x509']);
                        
                                if (!empty($idp['x509_new'])) {
                        Severity: Major
                        Found in src/classes/IdpsHelper.php - About 3 hrs to fix

                          File show.ts has 321 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /**
                           * @author Nicolas CARPi <nico-git@deltablot.email>
                           * @copyright 2012 Nicolas CARPi
                           * @see https://www.elabftw.net Official website
                           * @license AGPL-3.0
                          Severity: Minor
                          Found in src/ts/show.ts - About 3 hrs to fix

                            File plugin.js has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            class AutoComplete {
                              editor;
                              options = {};
                              query = '';
                              hasFocus = true;
                            Severity: Minor
                            Found in src/js/tinymce-plugins/mention/plugin.js - About 3 hrs to fix

                              File EntitySqlBuilder.php has 315 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              
                              /**
                               * @author Nicolas CARPi <nico-git@deltablot.email>
                               * @copyright 2022 Nicolas CARPi
                              Severity: Minor
                              Found in src/classes/EntitySqlBuilder.php - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language