ehosp/eHOSP-Services-CE

View on GitHub

Showing 149 of 149 total issues

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

    'media' => [
        'add_new_folder'         => 'Ajouter un dossier',
        'audio_support'          => 'Votre navigateur ne supporte pas l\'élément audio.',
        'create_new_folder'      => 'Créer un nouveau dossier',
        'delete_folder_question' => 'La suppression d\'un dossier supprime tout son contenu !',
Severity: Major
Found in src/resources/lang/fr/voyager.php and 1 other location - About 4 hrs to fix
src/resources/lang/de/voyager.php on lines 142..179

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

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

    'media' => [
        'add_new_folder'         => 'Neuen Ordner Hinzufügen',
        'audio_support'          => 'Ihr Browser unterstützt das Audio Element nicht.',
        'create_new_folder'      => 'Neuen Ordner Erstellen',
        'delete_folder_question' => 'Das Löschen des Ordners wird alle darin enthaltenen Dateien und Ordnder löschen.',
Severity: Major
Found in src/resources/lang/de/voyager.php and 1 other location - About 4 hrs to fix
src/resources/lang/fr/voyager.php on lines 136..173

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

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

File voyager.php has 359 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return [
    'date' => [
        'last_week' => 'Semana Passada',
Severity: Minor
Found in src/resources/lang/pt/voyager.php - About 4 hrs to fix

    File voyager.php has 359 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    return [
        'date' => [
            'last_week' => 'الأسبوع الماضي',
    Severity: Minor
    Found in src/resources/lang/ar/voyager.php - About 4 hrs to fix

      File voyager.php has 358 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      return [
          'date' => [
              'last_week' => 'Semana Passada',
      Severity: Minor
      Found in src/resources/lang/pt_br/voyager.php - About 4 hrs to fix

        Method run has 110 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function run()
            {
                $setting = $this->findSetting('site.title');
                if (!$setting->exists) {
                    $setting->fill([
        Severity: Major
        Found in src/database/seeds/SettingsTableSeeder.php - About 4 hrs to fix

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

          <?php
          
          return [
          
              /*
          Severity: Major
          Found in src/resources/lang/gr/nav.php and 1 other location - About 4 hrs to fix
          src/resources/lang/en/nav.php on lines 1..49

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

          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

          <?php
          
          return [
          
              /*
          Severity: Major
          Found in src/resources/lang/en/nav.php and 1 other location - About 4 hrs to fix
          src/resources/lang/gr/nav.php on lines 1..49

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

          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 run has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              public function run()
              {
                  if (file_exists(base_path('routes/web.php'))) {
                      require base_path('routes/web.php');
          
          
          Severity: Minor
          Found in src/database/seeds/MenuItemsTableSeeder.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

          Method run has 80 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function run()
              {
                  $dataType = $this->dataType('slug', 'posts');
                  if (!$dataType->exists) {
                      $dataType->fill([
          Severity: Major
          Found in src/database/seeds/DataTypesTableSeeder.php - About 3 hrs to fix

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

            $(document).on('click', function() {
                $(document).ready(function() {
                    $('#sensor').change(function() {
                        // Grab the value selected
                        selection = this.value;
            Severity: Major
            Found in src/resources/assets/js/lib/nxt-events.js and 5 other locations - About 3 hrs to fix
            src/resources/assets/js/lib/nxt-events.js on lines 1..11
            src/resources/assets/js/lib/nxt-events.js on lines 25..35
            src/resources/assets/js/lib/nxt-events.js on lines 37..47
            src/resources/assets/js/lib/nxt-events.js on lines 49..59
            src/resources/assets/js/lib/nxt-events.js on lines 61..71

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

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

            $(document).on('click', function() {
                $(document).ready(function() {
                    $('#flow').change(function() {
                        // Grab the value selected
                        selection = this.value;
            Severity: Major
            Found in src/resources/assets/js/lib/nxt-events.js and 5 other locations - About 3 hrs to fix
            src/resources/assets/js/lib/nxt-events.js on lines 1..11
            src/resources/assets/js/lib/nxt-events.js on lines 13..23
            src/resources/assets/js/lib/nxt-events.js on lines 37..47
            src/resources/assets/js/lib/nxt-events.js on lines 49..59
            src/resources/assets/js/lib/nxt-events.js on lines 61..71

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

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

            $(document).on('click', function() {
                $(document).ready(function() {
                    $('#ready-surgical-tasks').change(function() {
                        // Grab the value selected
                        selection = this.value;
            Severity: Major
            Found in src/resources/assets/js/lib/nxt-events.js and 5 other locations - About 3 hrs to fix
            src/resources/assets/js/lib/nxt-events.js on lines 1..11
            src/resources/assets/js/lib/nxt-events.js on lines 13..23
            src/resources/assets/js/lib/nxt-events.js on lines 25..35
            src/resources/assets/js/lib/nxt-events.js on lines 37..47
            src/resources/assets/js/lib/nxt-events.js on lines 49..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 96.

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

            $(document).on('click', function() {
                $(document).ready(function() {
                    $('#action').change(function() {
                        // Grab the value selected
                        selection = this.value;
            Severity: Major
            Found in src/resources/assets/js/lib/nxt-events.js and 5 other locations - About 3 hrs to fix
            src/resources/assets/js/lib/nxt-events.js on lines 13..23
            src/resources/assets/js/lib/nxt-events.js on lines 25..35
            src/resources/assets/js/lib/nxt-events.js on lines 37..47
            src/resources/assets/js/lib/nxt-events.js on lines 49..59
            src/resources/assets/js/lib/nxt-events.js on lines 61..71

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

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

            $(document).on('click', function() {
                $(document).ready(function() {
                    $('#data').change(function() {
                        // Grab the value selected
                        selection = this.value;
            Severity: Major
            Found in src/resources/assets/js/lib/nxt-events.js and 5 other locations - About 3 hrs to fix
            src/resources/assets/js/lib/nxt-events.js on lines 1..11
            src/resources/assets/js/lib/nxt-events.js on lines 13..23
            src/resources/assets/js/lib/nxt-events.js on lines 25..35
            src/resources/assets/js/lib/nxt-events.js on lines 49..59
            src/resources/assets/js/lib/nxt-events.js on lines 61..71

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

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

            $(document).on('click', function() {
                $(document).ready(function() {
                    $('#advanced').change(function() {
                        // Grab the value selected
                        selection = this.value;
            Severity: Major
            Found in src/resources/assets/js/lib/nxt-events.js and 5 other locations - About 3 hrs to fix
            src/resources/assets/js/lib/nxt-events.js on lines 1..11
            src/resources/assets/js/lib/nxt-events.js on lines 13..23
            src/resources/assets/js/lib/nxt-events.js on lines 25..35
            src/resources/assets/js/lib/nxt-events.js on lines 37..47
            src/resources/assets/js/lib/nxt-events.js on lines 61..71

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

            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

            <?php
            
            namespace eHOSP\Http\Controllers\API\v1;
            
            use Illuminate\Http\Request;
            Severity: Major
            Found in src/app/Http/Controllers/API/v1/MedGis.php and 1 other location - About 2 hrs to fix
            src/app/Http/Controllers/API/v1/EmergencyContacts.php on lines 1..96

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

            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

            <?php
            
            namespace eHOSP\Http\Controllers\API\v1;
            
            use Illuminate\Http\Request;
            Severity: Major
            Found in src/app/Http/Controllers/API/v1/EmergencyContacts.php and 1 other location - About 2 hrs to fix
            src/app/Http/Controllers/API/v1/MedGis.php on lines 1..96

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

            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 nxt_motor has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function nxt_motor() {
                motorHTML = `
                <div id="left">
                    <div id="port">
                        <h3>Port</h3>
            Severity: Major
            Found in src/resources/assets/js/lib/nxt-ui.js - About 2 hrs to fix

              Method run has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function run()
                  {
                      $post = $this->findPost('lorem-ipsum-post');
                      if (!$post->exists) {
                          $post->fill([
              Severity: Major
              Found in src/database/seeds/PostsTableSeeder.php - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language