tests/Tables/Armaments/Partials/AbstractMeleeWeaponlikeStrengthSanctionsTableTest.php
Method I_can_get_all_values
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function I_can_get_all_values()
{
self::assertSame(
[
0 => [
Method provideMissingStrengthAndResult
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function provideMissingStrengthAndResult()
{
$values = [];
for ($missingStrength = -5; $missingStrength <= 0; $missingStrength++) {
$values[] = [
The method I_can_get_all_values() has 104 lines of code. Current threshold is set to 100. Avoid really long methods. Open
Open
public function I_can_get_all_values()
{
self::assertSame(
[
0 => [
- Exclude checks
Avoid excessively long class names like AbstractMeleeWeaponlikeStrengthSanctionsTableTest. Keep class name length under 40. Open
Open
abstract class AbstractMeleeWeaponlikeStrengthSanctionsTableTest extends AbstractStrengthSanctionsTableTest
{
/**
* @test
*/
- Read upRead up
- Exclude checks
LongClassName
Since: 2.9
Detects when classes or interfaces are declared with excessively long names.
Example
class ATooLongClassNameThatHintsAtADesignProblem {
}
interface ATooLongInterfaceNameThatHintsAtADesignProblem {
}
Source https://phpmd.org/rules/naming.html#longclassname
Avoid excessively long variable names like $meleeWeaponSanctionsTable. Keep variable name length under 20. Open
Open
$meleeWeaponSanctionsTable = new MeleeWeaponStrengthSanctionsTable();
- 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
The method I_can_get_sanction_data_for_any_strength_missing is not named in camelCase. Open
Open
public function I_can_get_sanction_data_for_any_strength_missing($missingStrength, array $expectedValues)
{
self::assertSame(
$expectedValues,
(new MeleeWeaponStrengthSanctionsTable())->getSanctionsForMissingStrength($missingStrength),
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method I_can_not_get_any_sanction_for_too_much_missing_strength is not named in camelCase. Open
Open
public function I_can_not_get_any_sanction_for_too_much_missing_strength($sanctionName)
{
$this->expectException(\DrdPlus\Tables\Armaments\Weapons\Exceptions\CanNotUseWeaponBecauseOfMissingStrength::class);
$sanctionGetter = 'get' . ucfirst($sanctionName) . 'Sanction';
(new MeleeWeaponStrengthSanctionsTable())->$sanctionGetter(11);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method I_can_get_all_values is not named in camelCase. Open
Open
public function I_can_get_all_values()
{
self::assertSame(
[
0 => [
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method I_get_always_zero_for_every_sanction_if_no_missing_strength is not named in camelCase. Open
Open
public function I_get_always_zero_for_every_sanction_if_no_missing_strength($sanctionName)
{
$sanctionGetter = 'get' . ucfirst($sanctionName) . 'Sanction';
$meleeWeaponSanctionsTable = new MeleeWeaponStrengthSanctionsTable();
self::assertSame(0, $meleeWeaponSanctionsTable->$sanctionGetter(0));
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method I_can_get_sanctions_for_missing_strength is not named in camelCase. Open
Open
public function I_can_get_sanctions_for_missing_strength()
{
self::assertSame(
[
'missing_strength' => 2,
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method I_can_get_header is not named in camelCase. Open
Open
public function I_can_get_header()
{
self::assertSame(
[['missing_strength', 'fight_number', 'attack_number', 'defense_number', 'base_of_wounds', 'can_use_armament']],
(new MeleeWeaponStrengthSanctionsTable())->getHeader()
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}