madbob/GASdottoNG

View on GitHub

Showing 494 of 494 total issues

Method userBooking has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function userBooking($userid = null)
    {
        $userobj = null;

        if (is_null($userid)) {
Severity: Minor
Found in code/app/Order.php - About 1 hr to fix

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

        public function up()
        {
            Schema::create('products', function (Blueprint $table) {
                $table->string('id')->primary();
                $table->timestamps();

      Method hasChangedProdcts has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function hasChangedProdcts()
          {
              $has_changed_products = false;
      
              if ($this->isActive()) {
      Severity: Minor
      Found in code/app/Aggregate.php - About 1 hr to fix

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

            public function up()
            {
                Schema::create('users', function (Blueprint $table) {
                    $table->string('id')->primary();
                    $table->timestamps();
        Severity: Minor
        Found in code/database/migrations/2014_10_12_000000_create_users_table.php - About 1 hr to fix

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

                      ret.find('button.btn-light').click(function(e) {
                          e.preventDefault();
                          e.stopPropagation();
                          input.popover('dispose');
                      });
          Severity: Major
          Found in code/resources/assets/js/popovers.js and 2 other locations - About 1 hr to fix
          code/resources/assets/js/password.js on lines 58..62
          code/resources/assets/js/popovers.js on lines 173..177

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

          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

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

                          ret.find('button.btn-light').click(function(e) {
                              e.preventDefault();
                              e.stopPropagation();
                              input.popover('dispose');
                          });
          Severity: Major
          Found in code/resources/assets/js/password.js and 2 other locations - About 1 hr to fix
          code/resources/assets/js/popovers.js on lines 77..81
          code/resources/assets/js/popovers.js on lines 173..177

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

          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

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

                      ret.find('button.btn-light').click(function(e) {
                          e.preventDefault();
                          e.stopPropagation();
                          input.popover('dispose');
                      });
          Severity: Major
          Found in code/resources/assets/js/popovers.js and 2 other locations - About 1 hr to fix
          code/resources/assets/js/password.js on lines 58..62
          code/resources/assets/js/popovers.js on lines 77..81

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

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

          function enforceMeasureDiscrete(node) {
              var form = node.closest('form');
              var selected = node.find('option:selected').val();
              var discrete = measure_discrete[selected];
              var disabled = (discrete == '1');
          Severity: Minor
          Found in code/resources/assets/js/gasdotto.js - About 1 hr to fix

            Method pendingPackages has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function pendingPackages()
                {
                    return $this->innerCache('pending_packages', function($obj) {
                        $ret = new Collection();
                        $products = $obj->products()->where('package_size', '!=', 0)->with('measure')->get();
            Severity: Minor
            Found in code/app/Order.php - About 1 hr to fix

              Method show has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function show(Request $request, $id)
                  {
                      $start = decodeDate($request->input('startdate'));
                      $end = decodeDate($request->input('enddate'));
                      $target = fromInlineId($request->input('target'));
              Severity: Minor
              Found in code/app/Http/Controllers/StatisticsController.php - About 1 hr to fix

                Method importJSON has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function importJSON($target, $json)
                    {
                        $type = $json->type;
                
                        /*
                Severity: Minor
                Found in code/app/Importers/GDXP/Transformations.php - About 1 hr to fix

                  Method storeUploadedFile has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function storeUploadedFile($request, $parameters)
                      {
                          try {
                              $f = $request->file('file', null);
                              if (is_null($f) || $f->isValid() == false) {
                  Severity: Minor
                  Found in code/app/Importers/CSV/CSVImporter.php - About 1 hr to fix

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

                                    ret.find('select[name=cycle] option').filter(function() {
                                        return $(this).html() == values[1];
                                    }).prop('selected', true);
                    Severity: Major
                    Found in code/resources/assets/js/popovers.js and 1 other location - About 1 hr to fix
                    code/resources/assets/js/popovers.js on lines 149..151

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

                    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

                                    ret.find('select[name=day] option').filter(function() {
                                        return $(this).html() == values[0];
                                    }).prop('selected', true);
                    Severity: Major
                    Found in code/resources/assets/js/popovers.js and 1 other location - About 1 hr to fix
                    code/resources/assets/js/popovers.js on lines 153..155

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

                    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

                                    success: function(data) {
                                        var upper = Lists.closeParent(form);
                                        var list = upper.closest('.loadable-list');
                                        upper.remove();
                                        Lists.testListsEmptiness(list);
                    Severity: Minor
                    Found in code/resources/assets/js/gasdotto.js and 1 other location - About 55 mins to fix
                    code/resources/assets/js/callables.js on lines 326..331

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

                    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

                            if (data.action != 'approve') {
                                var upper = lists.closeParent(form);
                                var list = upper.closest('.loadable-list');
                                upper.remove();
                                lists.testListsEmptiness(list);
                    Severity: Minor
                    Found in code/resources/assets/js/callables.js and 1 other location - About 55 mins to fix
                    code/resources/assets/js/gasdotto.js on lines 556..561

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

                    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\Migrations\Migration;
                    use Illuminate\Database\Schema\Blueprint;
                    use Illuminate\Support\Facades\Schema;
                    code/database/migrations/2024_03_20_145731_birth_place.php on lines 1..28

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

                    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\Migrations\Migration;
                    use Illuminate\Database\Schema\Blueprint;
                    use Illuminate\Support\Facades\Schema;
                    Severity: Minor
                    Found in code/database/migrations/2024_03_20_145731_birth_place.php and 1 other location - About 55 mins to fix
                    code/database/migrations/2023_11_26_152708_modifier_type_identifier.php on lines 1..28

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

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

                        static bookingTotal(editor) {
                            var form = $(editor).closest('form');
                            var data = this.serializeBooking(form);
                            var url = form.attr('data-dynamic-url');
                    
                    
                    Severity: Minor
                    Found in code/resources/assets/js/bookings.js - About 55 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 commons has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function commons($user)
                        {
                            $ret = [];
                    
                            if ($user->can('users.admin', $user->gas)) {
                    Severity: Minor
                    Found in code/app/View/Icons/User.php - About 55 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