lancew/DojoList

View on GitHub
tests-old/all_tests.php

Summary

Maintainability
A
0 mins
Test Coverage

Classes should not have a constructor method with the same name as the class
Open

    function AllTests()
    {
        $this->TestSuite('All tests');
        $this->addFile('tests/dojo_test.php');
        $this->addFile('tests/data_test.php');
Severity: Minor
Found in tests-old/all_tests.php by phpmd

Since: PHPMD 0.2

A constructor method should not have the same name as the enclosing class, consider to use the PHP 5 __construct method.

Example:

class MyClass {
       // this is bad because it is PHP 4 style
      public function MyClass() {}
      // this is good because it is a PHP 5 constructor
      public function __construct() {}
  }

Source: http://phpmd.org/rules/naming.txt

The method option uses an else expression. Else is never necessary and you can simplify the code to work without else.
Open

    } else {
        return 'http://dev.dojolist/data/dojo.xml';
    }
Severity: Minor
Found in tests-old/all_tests.php by phpmd

Since: PHPMD 1.4.0

An if expression with an else branch is never necessary. You can rewrite the conditions in a way that the else is not necessary and the code becomes simpler to read. To achieve this use early return statements. To achieve this you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example:

class Foo
  {
      public function bar($flag)
      {
          if ($flag) {
              // one branch
          } else {
              // another branch
          }
      }
  }

Source: http://phpmd.org/rules/cleancode.txt

The method AllTests is not named in camelCase.
Open

    function AllTests()
    {
        $this->TestSuite('All tests');
        $this->addFile('tests/dojo_test.php');
        $this->addFile('tests/data_test.php');
Severity: Minor
Found in tests-old/all_tests.php by phpmd

Since: PHPMD 0.2

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

Example:

class ClassName {
      public function get_name() {
      }
  }

Source: http://phpmd.org/rules/controversial.txt

There are no issues that match your filters.

Category
Status