alientronics/fleetany-attributes

View on GitHub

Showing 32 of 32 total issues

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

    }

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

    }

Function getRegisterInDatabase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getRegisterInDatabase($data)
    {
        if (!empty($data)) {
            foreach ($data as $index => $element) {
                if (is_numeric($element)) {
Severity: Minor
Found in tests/acceptance/DynamoDbKeyTest.php - About 25 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 saveFiles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function saveFiles(Request $request, $files)
    {
        if (!empty($files)) {
            foreach ($files as $file_attribute) {
                if ($request->hasFile($file_attribute)) {
Severity: Minor
Found in app/Repositories/HelperRepository.php - About 25 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 getDynamoDbLastRecordId has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getDynamoDbLastRecordId($entity)
    {
        $Keys = $entity::where([]);
        $Keys = $Keys->get();
    
Severity: Minor
Found in app/Repositories/HelperRepository.php - About 25 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

Avoid unused parameters such as '$onConnection'.
Open

    protected function seeInDatabase($table, array $data, $onConnection = null)
Severity: Minor
Found in tests/acceptance/DynamoDbKeyTest.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$onConnection'.
Open

    protected function seeInDatabase($table, array $data, $onConnection = null)
Severity: Minor
Found in tests/acceptance/MongoDbValueTest.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused local variables such as '$Keys'.
Open

            $Keys = $Keys1->merge($Keys2);

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Avoid unused parameters such as '$onConnection'.
Open

    protected function seeInDatabase($table, array $data, $onConnection = null)

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$connection'.
Open

    protected function seeIsSoftDeletedInDatabase($table, array $data, $connection = null)
Severity: Minor
Found in tests/acceptance/DynamoDbKeyTest.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$connection'.
Open

    protected function seeIsSoftDeletedInDatabase($table, array $data, $connection = null)
Severity: Minor
Found in tests/acceptance/MongoDbKeyTest.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$onConnection'.
Open

    protected function seeInDatabase($table, array $data, $onConnection = null)
Severity: Minor
Found in tests/acceptance/MongoDbKeyTest.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Severity
Category
Status
Source
Language