madbob/GASdottoNG

View on GitHub

Showing 437 of 494 total issues

Function select has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                select: function(event, ui) {
                    var aggregate_id = input.attr('data-aggregate');
                    var while_shipping = (input.closest('.modal.add-booking-while-shipping').length != 0);
                    var fill_target = input.closest('.fillable-booking-space').find('.other-booking');
                    fill_target.empty().append(utils.j().makeSpinner());
Severity: Minor
Found in code/resources/assets/js/bookings.js - About 1 hr to fix

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

        private function testAccess($modifier)
        {
            switch($modifier->target_type) {
                case 'App\Supplier':
                    $this->ensureAuth(['supplier.modify' => $modifier->target]);
    Severity: Minor
    Found in code/app/Services/ModifiersService.php - About 1 hr to fix

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

          public function getHistoryDetails(Request $request)
          {
              $this->checkAuth();
              $date = $request->input('date');
      
      
      Severity: Minor
      Found in code/app/Http/Controllers/MovementsController.php - About 1 hr to fix

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

            public function handleSave($gas, $request)
            {
                $satispay_info = null;
        
                if ($request->has('enable_satispay')) {
        Severity: Minor
        Found in code/app/Parameters/Config/Satispay.php - About 1 hr to fix

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

              private function notify($supplier, $e)
              {
                  $body = _i('Nuovo aggiornamento disponibile per il listino %s (%s). Consultalo dal pannello Fornitori -> Indice Remoto.', [$supplier->printableName(), printableDate($e->lastchange)]);
                  if (Notification::where('content', $body)->first() == null) {
                      $gas = Gas::all();
          Severity: Minor
          Found in code/app/Console/Commands/CheckRemoteProducts.php - About 1 hr to fix

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

                private function exportIntegralCES($gas, $objects, $filename, $body)
                {
                    $currency = Currency::where('context', 'integralces')->first();
            
                    return output_csv($filename, null, $objects, function($object) use ($gas, $currency, $body) {
            Severity: Minor
            Found in code/app/Http/Controllers/MovementsController.php - About 1 hr to fix

              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

                      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

                                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

                                Function readRID has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    private function readRID($user, $request)
                                    {
                                        if ($user->gas->hasFeature('rid')) {
                                            $rid = $user->rid;
                                            $changed = false;
                                Severity: Minor
                                Found in code/app/Services/UsersService.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

                                Function testConstraints has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function testConstraints($quantity, $variant = null, $only_mandatory = false)
                                    {
                                        $sorted_contraints = Constraint::sortedContraints($only_mandatory);
                                        foreach($sorted_contraints as $constraints) {
                                            foreach($constraints as $constraint) {
                                Severity: Minor
                                Found in code/app/BookedProduct.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

                                Function fixModifiers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function fixModifiers($id, $action)
                                    {
                                        switch($action) {
                                            case 'none':
                                                break;
                                Severity: Minor
                                Found in code/app/Services/OrdersService.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