protected/RISParser/StadtraetInnenData.php
Method parseFromHtml
has 34 lines of code (exceeds 30 allowed). Consider refactoring. Open
Open
public static function parseFromHtml(string $htmlFraktion, string $htmlAusschuss): ?self
{
if (!preg_match('/<h1 class="page-title">\n<span[^>]*>(?<name>[^<]*) <span/siuU', $htmlFraktion, $match)) {
throw new ParsingException('Not found: name');
}
The method parseFromHtml() has an NPath complexity of 256. The configured NPath complexity threshold is 200. Open
Open
public static function parseFromHtml(string $htmlFraktion, string $htmlAusschuss): ?self
{
if (!preg_match('/<h1 class="page-title">\n<span[^>]*>(?<name>[^<]*) <span/siuU', $htmlFraktion, $match)) {
throw new ParsingException('Not found: name');
}
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
TODO found Open
Open
// @TODO This is only the first page with the most recent memberships
- Exclude checks
Avoid excessively long variable names like $fraktionsMitgliedschaften. Keep variable name length under 20. Open
Open
public array $fraktionsMitgliedschaften;
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $ausschussMitgliedschaften. Keep variable name length under 20. Open
Open
public array $ausschussMitgliedschaften;
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}