alientronics/fleetany-web

View on GitHub

Showing 188 of 188 total issues

File VehicleController.php has 279 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
Severity: Minor
Found in app/Http/Controllers/VehicleController.php - About 2 hrs to fix

    Method setUp has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function setUp($lang = null)
        {
            $company = Company::forceCreate(['name' => $this->name . ' Inc.']);
            $company->save();
            $this->setUserProperties($company, $lang);
    Severity: Major
    Found in app/Entities/User.php - About 2 hrs to fix

      Consider simplifying this complex logical expression.
      Open

              if (a && getParsingFlags(m).overflow === -2) {
                  overflow =
                      a[MONTH]       < 0 || a[MONTH]       > 11  ? MONTH :
                      a[DATE]        < 1 || a[DATE]        > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
                      a[HOUR]        < 0 || a[HOUR]        > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
      Severity: Critical
      Found in public/js/moment.js - About 2 hrs to fix

        Method testSetUp has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function testSetUp()
            {
                $company = factory(\App\Entities\Company::class)->create();
                $user = factory(\App\Entities\User::class)->create([
                    'company_id' => $company->id,
        Severity: Major
        Found in tests/unit/UserModelTest.php - About 2 hrs to fix

          File PartRepositoryEloquent.php has 260 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace App\Repositories;
          
          use Prettus\Repository\Eloquent\BaseRepository;
          Severity: Minor
          Found in app/Repositories/PartRepositoryEloquent.php - About 2 hrs to fix

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

                    $this->type('01/01/2016 15:15:15', 'pickup_date')
                        ->type('02/01/2016 15:15:15', 'deliver_date')
                        ->type('1200 First Av', 'pickup_place')
                        ->type('345 63th St', 'deliver_place')
                        ->type('320', 'begin_mileage')
            Severity: Major
            Found in tests/acceptance/TripControllerTest.php and 1 other location - About 2 hrs to fix
            tests/acceptance/TripControllerTest.php on lines 69..83

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

            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

                    $this->type('01/02/2016 15:15:15', 'pickup_date')
                        ->type('02/02/2016 15:15:15', 'deliver_date')
                        ->type('1220 First Av', 'pickup_place')
                        ->type('342 63th St', 'deliver_place')
                        ->type('322', 'begin_mileage')
            Severity: Major
            Found in tests/acceptance/TripControllerTest.php and 1 other location - About 2 hrs to fix
            tests/acceptance/TripControllerTest.php on lines 28..42

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

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

                public function edit($idVehicle)
                {
                    $vehicle = $this->vehicleRepo->find($idVehicle);
                    $this->helper->validateRecord($vehicle);
            
            
            Severity: Major
            Found in app/Http/Controllers/VehicleController.php - About 2 hrs to fix

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

                  public function testSort()
                  {
                      $this->visit('/contact?id=&name=&contact-type=&city=&sort=id-desc')
                          ->see('mode_edit</i>');
                      
              Severity: Major
              Found in tests/acceptance/ContactControllerTest.php and 3 other locations - About 2 hrs to fix
              tests/acceptance/CompanyControllerTest.php on lines 103..128
              tests/acceptance/ModelControllerTest.php on lines 88..113
              tests/acceptance/VehicleControllerTest.php on lines 126..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 124.

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

                  public function testSort()
                  {
                      $this->visit('/company?id=&name=&city=&country=&sort=id-desc')
                          ->see('mode_edit</i>');
                      
              Severity: Major
              Found in tests/acceptance/CompanyControllerTest.php and 3 other locations - About 2 hrs to fix
              tests/acceptance/ContactControllerTest.php on lines 128..153
              tests/acceptance/ModelControllerTest.php on lines 88..113
              tests/acceptance/VehicleControllerTest.php on lines 126..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 124.

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

                  public function testSort()
                  {
                      $this->visit('/vehicle?id=&model-vehicle=&number=&cost=&sort=id-desc')
                          ->see('mode_edit</i>');
                      
              Severity: Major
              Found in tests/acceptance/VehicleControllerTest.php and 3 other locations - About 2 hrs to fix
              tests/acceptance/CompanyControllerTest.php on lines 103..128
              tests/acceptance/ContactControllerTest.php on lines 128..153
              tests/acceptance/ModelControllerTest.php on lines 88..113

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

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

                  public function testSort()
                  {
                      $this->visit('/model?id=&model-type=&vendor=&name=&sort=id-desc')
                          ->see('mode_edit</i>');
                      
              Severity: Major
              Found in tests/acceptance/ModelControllerTest.php and 3 other locations - About 2 hrs to fix
              tests/acceptance/CompanyControllerTest.php on lines 103..128
              tests/acceptance/ContactControllerTest.php on lines 128..153
              tests/acceptance/VehicleControllerTest.php on lines 126..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 124.

              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 VehicleRepositoryEloquent.php has 255 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              namespace App\Repositories;
              
              use Prettus\Repository\Eloquent\BaseRepository;
              Severity: Minor
              Found in app/Repositories/VehicleRepositoryEloquent.php - About 2 hrs to fix

                Function create__createDuration has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function create__createDuration (input, key) {
                        var duration = input,
                            // matching against regexp is expensive, do it on demand
                            match = null,
                            sign,
                Severity: Major
                Found in public/js/moment.js - About 2 hrs to fix

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

                      protected function seeIsSoftDeletedInDatabase($table, array $data, $connection = null)
                      {
                          $database = $this->app->make('db');
                      
                          $connection = $connection ?: $database->getDefaultConnection();
                  Severity: Major
                  Found in tests/AcceptanceTestCase.php and 1 other location - About 2 hrs to fix
                  tests/AcceptanceTestCase.php on lines 118..137

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

                  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

                      protected function seeIsNotSoftDeletedInDatabase($table, array $data, $connection = null)
                      {
                          $database = $this->app->make('db');
                      
                          $connection = $connection ?: $database->getDefaultConnection();
                  Severity: Major
                  Found in tests/AcceptanceTestCase.php and 1 other location - About 2 hrs to fix
                  tests/AcceptanceTestCase.php on lines 147..166

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

                  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

                      public function destroy($idTrip)
                      {
                          $trip = $this->tripRepo->find($idTrip);
                          if ($trip) {
                              $this->helper->validateRecord($trip);
                  Severity: Major
                  Found in app/Http/Controllers/TripController.php and 2 other locations - About 2 hrs to fix
                  app/Http/Controllers/EntryController.php on lines 167..178
                  app/Http/Controllers/PartController.php on lines 183..194

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

                  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

                      public function destroy($idEntry)
                      {
                          $entry = $this->entryRepo->find($idEntry);
                          if ($entry) {
                              $this->helper->validateRecord($entry);
                  Severity: Major
                  Found in app/Http/Controllers/EntryController.php and 2 other locations - About 2 hrs to fix
                  app/Http/Controllers/PartController.php on lines 183..194
                  app/Http/Controllers/TripController.php on lines 151..162

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

                  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

                      public function destroy($idPart)
                      {
                          $part = $this->partRepo->find($idPart);
                          if ($part) {
                              $this->helper->validateRecord($part);
                  Severity: Major
                  Found in app/Http/Controllers/PartController.php and 2 other locations - About 2 hrs to fix
                  app/Http/Controllers/EntryController.php on lines 167..178
                  app/Http/Controllers/TripController.php on lines 151..162

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

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

                      function configFromStringAndFormat(config) {
                          // TODO: Move this to another part of the creation flow to prevent circular deps
                          if (config._f === utils_hooks__hooks.ISO_8601) {
                              configFromISO(config);
                              return;
                  Severity: Minor
                  Found in public/js/moment.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language