madbob/GASdottoNG

View on GitHub

Showing 437 of 494 total issues

Method readDefinition has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function readDefinition($modifier, $json)
    {
        $definitions = [];

        if (isset($json->fixed)) {
Severity: Minor
Found in code/app/Importers/GDXP/Transformations.php - About 1 hr to fix

    Method commons has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function commons($user)
        {
            static $gas_count = null;
    
            $ret = [
    Severity: Minor
    Found in code/app/View/Icons/Aggregate.php - About 1 hr to fix

      Function success has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  success: (data) => {
                      if (data.hasOwnProperty('status') && data.status == 'error') {
                          utils.displayServerError(null, data);
                          return;
                      }
      Severity: Minor
      Found in code/resources/assets/js/bookings.js - About 1 hr to fix

        Method queryMovements has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function queryMovements($query = null, $type = 'all')
            {
                if (is_null($query)) {
                    $query = Movement::orderBy('created_at', 'desc');
                }
        Severity: Minor
        Found in code/app/Supplier.php - About 1 hr to fix

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

              protected function create(array $data)
              {
                  $gas = Gas::find($data['gas_id']);
          
                  $user = new User();
          Severity: Minor
          Found in code/app/Http/Controllers/Auth/RegisterController.php - About 1 hr to fix

            Method roleByFunction has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function roleByFunction($identifier)
            {
                $gas = currentAbsoluteGas();
                $role_id = $gas->roles[$identifier] ?? null;
                $ret = App\Role::find($role_id);
            Severity: Minor
            Found in code/app/Helpers/Permissions.php - About 1 hr to fix

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

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

                Method formatSummaryShipping has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function formatSummaryShipping($order, $fields, $status, $shipping_place, $extra_modifiers)
                    {
                        $rows = [];
                        $total = 0;
                        $formattable = OrderFormatter::formattableColumns('summary');
                Severity: Minor
                Found in code/app/Printers/Concerns/Summary.php - About 1 hr to fix

                  Function init has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      static init(container)
                      {
                          $('.dates-for-orders', container).each((index, item) => {
                              /*
                                  Questo è per fare in modo che le date siano sempre coerenti tra
                  Severity: Minor
                  Found in code/resources/assets/js/orders.js - About 1 hr to fix

                    Method index has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function index(Request $request)
                        {
                            try {
                                $data['movements'] = $this->service->list($request->all());
                                $ret = null;
                    Severity: Minor
                    Found in code/app/Http/Controllers/MovementsController.php - About 1 hr to fix

                      Method store has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function store(Request $request)
                          {
                              DB::beginTransaction();
                      
                              $data = $request->input('data');
                      Severity: Minor
                      Found in code/app/Http/Controllers/AggregatesController.php - About 1 hr to fix

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

                            public function up()
                            {
                                Schema::table('roles', function (Blueprint $table) {
                                    $table->string('identifier')->default('');
                                    $table->boolean('system')->default(false);
                        Severity: Minor
                        Found in code/database/migrations/2022_12_01_181229_advanced_roles.php - About 1 hr to fix

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

                              public function run($request)
                              {
                                  $user = Auth::user();
                                  $service = app()->make('BookingsService');
                          
                          
                          Severity: Minor
                          Found in code/app/Importers/CSV/Deliveries.php - About 1 hr to fix

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

                                private function filterBySupplier($supplier, $user, $query, $own)
                                {
                                    $type = 'all';
                            
                                    if ($supplier) {
                            Severity: Minor
                            Found in code/app/Services/MovementsService.php - About 1 hr to fix

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

                                  public function handle()
                                  {
                                      $hub = app()->make('GlobalScopeHub');
                                      $gas = $hub->getGasObj();
                              
                              
                              Severity: Minor
                              Found in code/app/Jobs/NotifyRemindOrder.php - About 1 hr to fix

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

                                    public static function selective()
                                    {
                                        if (currentAbsoluteGas()->hasFeature('shipping_places')) {
                                            return [
                                                'truck' => (object) [
                                Severity: Minor
                                Found in code/app/View/Icons/AggregateBooking.php - About 1 hr to fix

                                  Function updateBookingModifiers has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      static updateBookingModifiers(dynamic_modifiers, container)
                                      {
                                          $('input[name^="modifier-"]', container).each(function() {
                                              let modid = parseInt($(this).attr('name').split('-')[1]);
                                              if (modid == 0) {
                                  Severity: Minor
                                  Found in code/resources/assets/js/modifiers.js - About 1 hr to fix

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

                                        public static function descriptions($target)
                                        {
                                            /*
                                                Qui predispongo le stringhe descrittive per tutte le possibili
                                                combinazioni di valori, destinate a rendere più comprensibile la
                                    Severity: Minor
                                    Found in code/app/View/Texts/Modifier.php - About 1 hr to fix

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

                                          public function getConvenientStringsAttribute()
                                          {
                                              $suppliers = [];
                                              $shipping_date = PHP_INT_MAX;
                                      
                                      
                                      Severity: Minor
                                      Found in code/app/AggregateBooking.php - About 1 hr to fix

                                        Function completionRowsInit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        function completionRowsInit(node) {
                                            $(node).find('input:text').each(function() {
                                                if ($(this).hasClass('ui-autocomplete-input') == true) {
                                                    return;
                                                }
                                        Severity: Minor
                                        Found in code/resources/assets/js/gasdotto.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language