CharacterInfo
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
class CharacterInfo extends ExtensibleModel
{
use HasFactory, NotableTrait;
/**
The class CharacterInfo has 41 public methods. Consider refactoring CharacterInfo to keep number of public methods under 10. Open
class CharacterInfo extends ExtensibleModel
{
use HasFactory, NotableTrait;
/**
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class CharacterInfo has 42 non-getter- and setter-methods. Consider refactoring CharacterInfo to keep number of methods under 25. Open
class CharacterInfo extends ExtensibleModel
{
use HasFactory, NotableTrait;
/**
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
File CharacterInfo.php
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of SeAT
*
The class CharacterInfo has a coupling between objects value of 48. Consider to reduce the number of dependencies under 13. Open
class CharacterInfo extends ExtensibleModel
{
use HasFactory, NotableTrait;
/**
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Avoid using static access to class '\Seat\Tests\Eveapi\Database\Factories\CharacterInfoFactory' in method 'newFactory'. Open
return CharacterInfoFactory::new();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method corporation_history is not named in camelCase. Open
public function corporation_history()
{
return $this->hasMany(CharacterCorporationHistory::class, 'character_id', 'character_id')
->orderByDesc('record_id');
- 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 skill_queue is not named in camelCase. Open
public function skill_queue()
{
return $this->hasMany(CharacterSkillQueue::class, 'character_id', 'character_id')
->orderBy('queue_position');
}
- 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 wallet_journal is not named in camelCase. Open
public function wallet_journal()
{
return $this->hasMany(CharacterWalletJournal::class,
'character_id', 'character_id');
- 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 agent_research is not named in camelCase. Open
public function agent_research()
{
return $this->hasMany(CharacterAgentResearch::class,
'character_id', 'character_id');
- 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 pilot_attributes is not named in camelCase. Open
public function pilot_attributes()
{
return $this->hasOne(CharacterAttribute::class, 'character_id', 'character_id')
->withDefault();
- 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 refresh_token is not named in camelCase. Open
public function refresh_token()
{
return $this->hasOne(RefreshToken::class, 'character_id', 'character_id');
}
- 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 jump_clones is not named in camelCase. Open
public function jump_clones()
{
return $this->hasMany(CharacterJumpClone::class,
'character_id', 'character_id');
- 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 calendar_events is not named in camelCase. Open
public function calendar_events()
{
return $this->hasMany(CharacterCalendarEvent::class,
'character_id', 'character_id');
- 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 loyalty_points is not named in camelCase. Open
public function loyalty_points()
{
return $this->belongsToMany(CorporationInfo::class, 'character_loyalty_points', 'character_id', 'corporation_id')
->using(CharacterLoyaltyPoints::class)
->withPivot('amount')
- 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 contact_labels is not named in camelCase. Open
public function contact_labels()
{
return $this->hasMany(CharacterLabel::class,
'character_id', 'character_id');
- 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 corporation_roles is not named in camelCase. Open
public function corporation_roles()
{
return $this->hasMany(CharacterRole::class,
'character_id', 'character_id');
- 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 wallet_transactions is not named in camelCase. Open
public function wallet_transactions()
{
return $this->hasMany(CharacterWalletTransaction::class,
'character_id', 'character_id');
- 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() {
}
}