ehosp/eHOSP-Services-CE

View on GitHub

Showing 149 of 149 total issues

Method dataTypesTranslations has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function dataTypesTranslations()
    {
        // Adding translations for 'display_name_singular'
        //
        $_fld = 'display_name_singular';
Severity: Major
Found in src/database/seeds/TranslationsTableSeeder.php - About 2 hrs to fix

    File CountryToLang.php has 253 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /*
    |--------------------------------------------------------------------------
    | Country Code to Language Code
    Severity: Minor
    Found in src/global/data/CountryToLang.php - About 2 hrs to fix

      File CountryToCode.php has 252 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /*
      |--------------------------------------------------------------------------
      | Country Name to Country Code
      Severity: Minor
      Found in src/global/data/CountryToCode.php - About 2 hrs to fix

        Method handle has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function handle()
            {
                $originalTile = $this->ask('Please give a title to the post:');
                $author = $this->ask('Please specify the author:');
                $image = $image_alt = "";
        Severity: Minor
        Found in src/app/Console/Commands/NewBlogPost.php - About 2 hrs to fix

          Function fileUpload has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

          function fileUpload() {
              var x = document.getElementById("myFile");
              var txt = "";
              if ('files' in x) {
                  if (x.files.length == 0) {
          Severity: Minor
          Found in src/resources/assets/js/lib/nxt-ui.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 nxt_sound has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function nxt_sound() {
              soundHTML = `
              <div id="left">
                  <div id="action">
                      <h3>Action</h3>
          Severity: Minor
          Found in src/resources/assets/js/lib/nxt-ui.js - About 1 hr to fix

            Method menusTranslations has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function menusTranslations()
                {
                    $_tpl = ['menu_items', 'title'];
                    $_item = $this->findMenuItem('Dashboard');
                    if ($_item->exists) {
            Severity: Minor
            Found in src/database/seeds/TranslationsTableSeeder.php - About 1 hr to fix

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

                  'settings' => [
                      'usage_help'           => 'Her ayarın değerini sitenizdeki herhangi bir yerinden çağırabilirisiniz',
                      'save'                 => 'Ayarları Kaydet',
                      'new'                  => 'Yeni Ayarlar',
                      'help_name'            => 'Ayar Adı ex: Yönetici paneli',
              Severity: Major
              Found in src/resources/lang/tr/voyager.php and 1 other location - About 1 hr to fix
              src/resources/lang/ru/voyager.php on lines 115..138

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

              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

                  'settings' => [
                      'usage_help'           => 'Чтобы получить значения параметров, используйте в шаблоне код ',
                      'save'                 => 'Сохранить настройки',
                      'new'                  => 'Создать настройку',
                      'help_name'            => 'Название параметра (например, Мой параметр)',
              Severity: Major
              Found in src/resources/lang/ru/voyager.php and 1 other location - About 1 hr to fix
              src/resources/lang/tr/voyager.php on lines 111..134

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

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

                  private function dataTypesTranslations()
                  {
                      // Adding translations for 'display_name_singular'
                      //
                      $_fld = 'display_name_singular';
              Severity: Minor
              Found in src/database/seeds/TranslationsTableSeeder.php - 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

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

              <?php
              
              use Illuminate\Database\Seeder;
              use TCG\Voyager\Models\Category;
              
              
              Severity: Major
              Found in src/database/seeds/CategoriesTableSeeder.php and 1 other location - About 1 hr to fix
              src/database/seeds/RolesTableSeeder.php on lines 1..27

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

              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
              
              use Illuminate\Database\Seeder;
              use TCG\Voyager\Models\Role;
              
              
              Severity: Major
              Found in src/database/seeds/RolesTableSeeder.php and 1 other location - About 1 hr to fix
              src/database/seeds/CategoriesTableSeeder.php on lines 1..33

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

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

                  private function menusTranslations()
                  {
                      $_tpl = ['menu_items', 'title'];
                      $_item = $this->findMenuItem('Dashboard');
                      if ($_item->exists) {
              Severity: Minor
              Found in src/database/seeds/TranslationsTableSeeder.php - 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 __modal__ has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function __modal__(header, htmlBody) {
                  var html = `
                      <div class="modal-content">
                      <div class="modal-header">
                          <span class="close">Χ</span>
              Severity: Minor
              Found in src/resources/assets/js/lib/nxt-ui.js - About 1 hr to fix

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

                    $(".invisible-container").on('click', function() {
                        $(".invisible-container").toggleClass('invisible-click');
                        $("#smart-assistance-menu").toggle('slide', {direction: "right"}, 400);
                    });
                Severity: Major
                Found in src/resources/assets/js/main/jquery-scripts.js and 2 other locations - About 1 hr to fix
                src/resources/assets/js/main/jquery-scripts.js on lines 4..7
                src/resources/assets/js/main/jquery-scripts.js on lines 12..15

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

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

                    $(".shadow").on('click', function() {
                        $(".shadow").toggleClass('shadow-show');
                        $("#navbar-mobile-only").toggle('slide', {direction: "right"}, 400);
                    });
                Severity: Major
                Found in src/resources/assets/js/main/jquery-scripts.js and 2 other locations - About 1 hr to fix
                src/resources/assets/js/main/jquery-scripts.js on lines 4..7
                src/resources/assets/js/main/jquery-scripts.js on lines 22..25

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

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

                    $(".navbar-menu").on('click', function() {
                        $(".shadow").toggleClass('shadow-show');
                        $("#navbar-mobile-only").toggle('slide', {direction: "right"}, 400);
                    });
                Severity: Major
                Found in src/resources/assets/js/main/jquery-scripts.js and 2 other locations - About 1 hr to fix
                src/resources/assets/js/main/jquery-scripts.js on lines 12..15
                src/resources/assets/js/main/jquery-scripts.js on lines 22..25

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

                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

                    $("#smart-assistance-header").on('click', function() {
                        $("#smart-assistance-menu").toggle('slide', {direction: "right"}, 400);
                        $(".invisible-container").toggleClass('invisible-click');
                    });
                Severity: Major
                Found in src/resources/assets/js/main/jquery-scripts.js and 1 other location - About 1 hr to fix
                src/resources/assets/js/main/jquery-scripts.js on lines 8..11

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

                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

                    $("#navbar-mobile-only img").on('click', function() {
                        $("#navbar-mobile-only").toggle('slide', {direction: "right"}, 400);
                        $(".shadow").toggleClass('shadow-show');
                    });
                Severity: Major
                Found in src/resources/assets/js/main/jquery-scripts.js and 1 other location - About 1 hr to fix
                src/resources/assets/js/main/jquery-scripts.js on lines 18..21

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

                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

                Method up has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function up()
                    {
                        // Create table for storing roles
                        Schema::create('data_types', function (Blueprint $table) {
                            $table->increments('id');
                  Severity
                  Category
                  Status
                  Source
                  Language