alientronics/fleetany-api

View on GitHub

Showing 235 of 235 total issues

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class UserTest extends TestCase
Severity: Minor
Found in tests/UserTest.php by phpcodesniffer

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class AlertTest extends TestCase
Severity: Minor
Found in tests/AlertTest.php by phpcodesniffer

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class TestCase extends Laravel\Lumen\Testing\TestCase
Severity: Minor
Found in tests/TestCase.php by phpcodesniffer

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class TripTest extends TestCase
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class GpsTest extends TestCase
Severity: Minor
Found in tests/GpsTest.php by phpcodesniffer

The parameter $ideal_pressure is not named in camelCase.
Open

    public function sendAlertTireMail($company, $vehicle_id, $tireSensor, $ideal_pressure, $users)
    {
        try {
            $vehicle = Vehicle::where('id', $vehicle_id)->first();
    

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $vehicle_id is not named in camelCase.
Open

    public function sendAlertTireMail($company, $vehicle_id, $tireSensor, $ideal_pressure, $users)
    {
        try {
            $vehicle = Vehicle::where('id', $vehicle_id)->first();
    

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $ideal_pressure is not named in camelCase.
Open

    private function generateEntry($company, $tireSensor, $ideal_pressure)
    {
        if (!$this->hasPressureIssue($company, $tireSensor, $ideal_pressure)) {
            $tireSensor = TireSensor::where('part_id', $tireSensor->part_id)
                ->where('created_at', '<', $tireSensor->created_at)

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $company_id is not named in camelCase.
Open

    public function checkTireCondition($company_id, $tiresensor_id, $vehicle_id)
    {
        $tireSensor = TireSensor::find($tiresensor_id);
        $company = Company::where('id', $company_id)->first();
    

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $tiresensor_id is not named in camelCase.
Open

    public function checkTireCondition($company_id, $tiresensor_id, $vehicle_id)
    {
        $tireSensor = TireSensor::find($tiresensor_id);
        $company = Company::where('id', $company_id)->first();
    

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $ideal_pressure is not named in camelCase.
Open

    public function getAlertType($company, $tireSensor, $ideal_pressure)
    {
        $alertType = [];
        if ((((1 - $company->delta_pressure) * $ideal_pressure) - 1.5) > $tireSensor->pressure) {
            $alertType['type'] = Lang::get('mails.Pressure');

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $ideal_pressure is not named in camelCase.
Open

    private function hasPressureIssue($company, $tireSensor, $ideal_pressure)
    {
        $alertType = $this->getAlertType($company, $tireSensor, $ideal_pressure);
        if (empty($alertType['id']) ||
            ($alertType['id'] != 'High Pressure' && $alertType['id'] != 'Low Pressure')) {

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $vehicle_id is not named in camelCase.
Open

    public function checkTireCondition($company_id, $tiresensor_id, $vehicle_id)
    {
        $tireSensor = TireSensor::find($tiresensor_id);
        $company = Company::where('id', $company_id)->first();
    

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Avoid deeply nested control flow statements.
Open

                        if (!empty($part->part_id)) {
                            PartEntry::forceCreate([
                                "part_id" => $part->part_id,
                                "entry_id" => $entry->id,
                            ]);
Severity: Major
Found in app/Http/Controllers/TireConditionController.php - About 45 mins to fix

    Method sendAlertTireMail has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function sendAlertTireMail($company, $vehicle_id, $tireSensor, $ideal_pressure, $users)
    Severity: Minor
    Found in app/Http/Controllers/AlertController.php - About 35 mins to fix

      Function closing brace must go on the next line following the body; found 1 blank lines before brace
      Open

          }
      Severity: Minor
      Found in tests/UserTest.php by phpcodesniffer

      Function closing brace must go on the next line following the body; found 1 blank lines before brace
      Open

          }
      Severity: Minor
      Found in tests/CompanyTest.php by phpcodesniffer

      Function closing brace must go on the next line following the body; found 1 blank lines before brace
      Open

          }
      Severity: Minor
      Found in tests/GpsTest.php by phpcodesniffer

      Function closing brace must go on the next line following the body; found 1 blank lines before brace
      Open

          }
      Severity: Minor
      Found in tests/GpsTest.php by phpcodesniffer

      The closing brace for the class must go on the next line after the body
      Open

      }
      Severity: Minor
      Found in tests/CompanyTest.php by phpcodesniffer
      Severity
      Category
      Status
      Source
      Language