Showing 223 of 223 total issues
File MissionListTest.php
has 624 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Created by PhpStorm.
* User: JC
* Date: 2016-11-18
- Create a ticketCreate a ticket
Function imageInfo
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function imageInfo(array $files, $width = 0): array
{
if (empty($files)) {
return [];
}
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File MissionTest.php
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Created by PhpStorm.
* User: JC
* Date: 2016-11-28
- Create a ticketCreate a ticket
The class Mission has 11 public methods. Consider refactoring Mission to keep number of public methods under 10. Open
class Mission extends Template
{
private $advanced = false;
/**
- Read upRead up
- Create a ticketCreate a ticket
- 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 Parse has 12 public methods. Consider refactoring Parse to keep number of public methods under 10. Open
class Parse
{
use Properties {
properties as traitProperties;
}
- Read upRead up
- Create a ticketCreate a ticket
- 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 Indexer has 13 public methods. Consider refactoring Indexer to keep number of public methods under 10. Open
class Indexer
{
/**
* @var array
*/
- Read upRead up
- Create a ticketCreate a ticket
- 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 CrewMember has 20 public methods. Consider refactoring CrewMember to keep number of public methods under 10. Open
class CrewMember extends Model implements Hyperlink
{
/**
* Member name, also used in generating URI & page
*
- Read upRead up
- Create a ticketCreate a ticket
- 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 CrewMember has an overall complexity of 57 which is very high. The configured complexity threshold is 50. Open
class CrewMember extends Model implements Hyperlink
{
/**
* Member name, also used in generating URI & page
*
- Create a ticketCreate a ticket
- Exclude checks
The class MissionList has an overall complexity of 57 which is very high. The configured complexity threshold is 50. Open
class MissionList extends WikiBase
{
/**
* List of all missions, organized by episodes/cadet
*
- Create a ticketCreate a ticket
- Exclude checks
The class IndexerTest has 11 public methods. Consider refactoring IndexerTest to keep number of public methods under 10. Open
class IndexerTest extends TestCase
{
/**
* @var Wiki
*/
- Read upRead up
- Create a ticketCreate a ticket
- 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 CrewList has 16 public methods. Consider refactoring CrewList to keep number of public methods under 10. Open
class CrewList extends Template
{
/**
* Maximum skills statistics
*
- Read upRead up
- Create a ticketCreate a ticket
- 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
CrewMember
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class CrewMember extends Model implements Hyperlink
{
/**
* Member name, also used in generating URI & page
*
- Create a ticketCreate a ticket
Function parseStep
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function parseStep(string $text): array
{
$columns = [
'steptitle' => 'name',
'choice' => 'alt',
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method testNew
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testNew()
{
$api = $this->newApiInstance();
$text = (file_get_contents(
static::DIR_SAMPLE . '/Crew-crew_member_list.txt'
- Create a ticketCreate a ticket
MissionListTest
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class MissionListTest extends TestCase
{
private $wiki;
/**
- Create a ticketCreate a ticket
Method checkCadetMissionSteps
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkCadetMissionSteps(MissionModel $model)
{
$this->checkMissionStep(
$model->steps[0],
[
- Create a ticketCreate a ticket
Method checkCadetAdvMissionSteps
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkCadetAdvMissionSteps(MissionModel $model)
{
$this->checkMissionStep(
$model->steps[0],
[
- Create a ticketCreate a ticket
File MissionList.php
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Created by PhpStorm.
* User: JC
* Date: 2016-11-17
- Create a ticketCreate a ticket
Method parseStepProp
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseStepProp(
string $key,
string $values,
string $advValues
) {
- Create a ticketCreate a ticket
File Mission.php
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Created by PhpStorm.
* User: JC
* Date: 2016-11-20
- Create a ticketCreate a ticket