alientronics/fleetany-api

View on GitHub

Showing 235 of 235 total issues

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

                $inputsCreate['driver_id'] = $user->contact->id;

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

            $inputsCreate['pickup_date'] = Carbon::now();

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

                $inputsCreate['accuracy'] = $inputs['accuracy'];

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

            $inputsCreate['fuel_type'] = $inputs['fuel_type'];

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

            $Trip = Trip::forceCreate($inputsCreate);

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

            $type = Type::where('company_id', $inputsCreate['company_id'])

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

                $inputsCreate['latitude'] = $inputs['latitude'];

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

                $inputsCreate['altitudeAccuracy'] = $inputs['altitudeAccuracy'];

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

                $inputsCreate['heading'] = $inputs['heading'];

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

                $inputsCreate['speed'] = $inputs['speed'];

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

            $inputsCreate['vehicle_id'] = $inputs['vehicle_id'];

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$inputsCreate' which will lead to PHP notices.
Open

            $inputsCreate['fuel_cost'] = $inputs['fuel_cost'];

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$response' which will lead to PHP notices.
Open

        $response['fuelTypes'] = Type::where('entity_key', 'fuel')

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

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

    public function testGpsPostSuccessDataIsCompressed()
    {
        $company = factory('App\Company')->create();

        $this->actingAs($company)
Severity: Minor
Found in tests/GpsTest.php - About 1 hr to fix

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

        public function create(Request $request)
        {
            $gpsData = $request->all();
            
            if (!empty($gpsData)) {
    Severity: Minor
    Found in app/Http/Controllers/GpsController.php - About 1 hr to fix

      Function create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function create(Request $request)
          {
              $inputs = $request->all();
                  
              if (!empty($inputs['json'])) {
      Severity: Minor
      Found in app/Http/Controllers/TireSensorController.php - About 1 hr 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 create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function create(Request $request)
          {
              $gpsData = $request->all();
              
              if (!empty($gpsData)) {
      Severity: Minor
      Found in app/Http/Controllers/GpsController.php - About 1 hr 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

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

          public function create(Request $request)
          {
              try {
                  $inputs = $request->all();
                  $user = User::where('email', $inputs['email'])->first();
      Severity: Minor
      Found in app/Http/Controllers/TripController.php - About 1 hr to fix

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

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

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

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