src/Shop/Monitor/Order.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '19', column '22').
Open

        $model = new Shop_Order();
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '36', column '22').
Open

        $model = new Shop_OrderItem();
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Remove the unused function parameter "$request".
Open

    public static function amount($request, $match){
Severity: Major
Found in src/Shop/Monitor/Order.php by sonar-php

Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

Noncompliant Code Example

function doSomething($a, $b) { // "$a" is unused
  return compute($b);
}

Compliant Solution

function doSomething($b) {
  return compute($b);
}

Exceptions

Functions in classes that override a class or implement interfaces are ignored.

class C extends B {

  function doSomething($a, $b) {     // no issue reported on $b
    compute($a);
  }

}

See

  • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
  • MISRA C:2012, 2.7 - There should be no unused parameters in functions
  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect

Remove the unused function parameter "$request".
Open

    public static function count($request, $match){
Severity: Major
Found in src/Shop/Monitor/Order.php by sonar-php

Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

Noncompliant Code Example

function doSomething($a, $b) { // "$a" is unused
  return compute($b);
}

Compliant Solution

function doSomething($b) {
  return compute($b);
}

Exceptions

Functions in classes that override a class or implement interfaces are ignored.

class C extends B {

  function doSomething($a, $b) {     // no issue reported on $b
    compute($a);
  }

}

See

  • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
  • MISRA C:2012, 2.7 - There should be no unused parameters in functions
  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect

Remove the unused function parameter "$match".
Open

    public static function amount($request, $match){
Severity: Major
Found in src/Shop/Monitor/Order.php by sonar-php

Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

Noncompliant Code Example

function doSomething($a, $b) { // "$a" is unused
  return compute($b);
}

Compliant Solution

function doSomething($b) {
  return compute($b);
}

Exceptions

Functions in classes that override a class or implement interfaces are ignored.

class C extends B {

  function doSomething($a, $b) {     // no issue reported on $b
    compute($a);
  }

}

See

  • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
  • MISRA C:2012, 2.7 - There should be no unused parameters in functions
  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect

Remove the unused function parameter "$match".
Open

    public static function count($request, $match){
Severity: Major
Found in src/Shop/Monitor/Order.php by sonar-php

Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

Noncompliant Code Example

function doSomething($a, $b) { // "$a" is unused
  return compute($b);
}

Compliant Solution

function doSomething($b) {
  return compute($b);
}

Exceptions

Functions in classes that override a class or implement interfaces are ignored.

class C extends B {

  function doSomething($a, $b) {     // no issue reported on $b
    compute($a);
  }

}

See

  • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
  • MISRA C:2012, 2.7 - There should be no unused parameters in functions
  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect

Avoid unused parameters such as '$match'.
Open

    public static function amount($request, $match){
Severity: Minor
Found in src/Shop/Monitor/Order.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 '$match'.
Open

    public static function count($request, $match){
Severity: Minor
Found in src/Shop/Monitor/Order.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 '$request'.
Open

    public static function amount($request, $match){
Severity: Minor
Found in src/Shop/Monitor/Order.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 '$request'.
Open

    public static function count($request, $match){
Severity: Minor
Found in src/Shop/Monitor/Order.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

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

class Shop_Monitor_Order {
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpcodesniffer

The class Shop_Monitor_Order is not named in CamelCase.
Open

class Shop_Monitor_Order {
    
    /**
     * Returns total number of orders
     * 
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Opening brace of a class must be on the line after the definition
Open

class Shop_Monitor_Order {
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpcodesniffer

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

}
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpcodesniffer

Expected 1 newline at end of file; 0 found
Open

}
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpcodesniffer

Whitespace found at end of line
Open

<?php 
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpcodesniffer

Opening brace should be on a new line
Open

    public static function amount($request, $match){
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpcodesniffer

Whitespace found at end of line
Open

     * 
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpcodesniffer

Whitespace found at end of line
Open

     * 
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpcodesniffer

Class name "Shop_Monitor_Order" is not in camel caps format
Open

class Shop_Monitor_Order {
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpcodesniffer

Opening brace should be on a new line
Open

    public static function count($request, $match){
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpcodesniffer

Whitespace found at end of line
Open

 * 
Severity: Minor
Found in src/Shop/Monitor/Order.php by phpcodesniffer

There are no issues that match your filters.

Category
Status