Showing 223 of 223 total issues
Method testResearchFutureHistory
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testResearchFutureHistory()
{
// @codingStandardsIgnoreStartc
$text
= <<<'EOT'
- Create a ticketCreate a ticket
Method skillValue
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function skillValue(string $table, array $skills): ?array
{
$regex = '/^\s*\|\s*\d+\s*$(.+?)\|[}-].*?$/imsu';
if (!preg_match_all($regex, $table, $levels)) {
return null;
- Create a ticketCreate a ticket
Method checkCadetStep4
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkCadetStep4(Mission $model)
{
$step = $model->steps[3];
$this->assertInstanceOf(MissionStep::class, $step);
$this->assertCount(2, $step->skills);
- Create a ticketCreate a ticket
Method checkExportedMissionCost
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkExportedMissionCost(array $mission)
{
$this->assertArrayHasKey(
'cost',
$mission,
- Create a ticketCreate a ticket
Method testPassAndCriticalCrewDoNotOverlap
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testPassAndCriticalCrewDoNotOverlap(Analyst $analyst)
{
$this->assertNotEmpty($analyst->getCrew());
$analyst->getMissions()->eachAway(
function (Mission $mission) {
- Create a ticketCreate a ticket
Function parse
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function parse()
{
preg_match('/\{\{currency\|([^}]+)}}\s*(.+)/iu', $this->found, $found);
if (!$found || !$found[0]) {
throw new EmptyTemplateException();
- 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
Function parse
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function parse(): array
{
$this->name = [];
$this->found = [];
$parts = explode('|', trim($this->wikiText, "{ }\t\n\r\0\xb"));
- 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 toArray
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArray(): array
{
if (static::SPACE_BATTLE === $this->type) {
return [
'cost' => $this->cost->toArray(),
- Create a ticketCreate a ticket
Method export
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function export(): array
{
$epi = 0;
$episodes = [];
$missions = [];
- Create a ticketCreate a ticket
Method parse
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse(): array
{
parent::parse();
$mission = [];
- Create a ticketCreate a ticket
Method testTuvix
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testTuvix()
{
$crew = $this->wiki->crew();
$member = $crew->byName('Tuvix');
$this->assertInstanceOf(CrewMember::class, $member);
- Create a ticketCreate a ticket
Method parse
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse()
{
preg_match('/\{\{currency\|([^}]+)}}\s*(.+)/iu', $this->found, $found);
if (!$found || !$found[0]) {
throw new EmptyTemplateException();
- Create a ticketCreate a ticket
Method testCadetCrew
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testCadetCrew(array $crew)
{
$missions = $this->wiki->missions()->get('cadet');
foreach ($crew['cadet'] as $idxCh => $challenge) {
foreach ($challenge as $idxMis => $mission) {
- Create a ticketCreate a ticket
Method toArray
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArray(): array
{
$skills = [];
foreach ($this->skills as $skill) {
$skills[] = $skill->toArray();
- Create a ticketCreate a ticket
Method parse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse(): array
{
$this->name = [];
$this->found = [];
$parts = explode('|', trim($this->wikiText, "{ }\t\n\r\0\xb"));
- Create a ticketCreate a ticket
Method checkExportedStepRequirements
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkExportedStepRequirements(
array $step,
int $idx,
string $mission
) {
- Create a ticketCreate a ticket
Method testRateStep
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testRateStep()
{
$analyst
= new Analyst($this->wiki->missions(), $this->wiki->crew());
- Create a ticketCreate a ticket
Method testEpisodeCrew
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testEpisodeCrew(array $crew)
{
$missions = $this->wiki->missions()->get('episodes');
foreach ($crew['episodes'] as $idxEpi => $episode) {
foreach ($episode as $idxMis => $mission) {
- Create a ticketCreate a ticket
Method testExportedMissions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testExportedMissions(array $exported)
{
$this->removeMissionTraitRich();
$idx = 0;
- Create a ticketCreate a ticket
Function createModel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function createModel(): MissionModel
{
$model = new MissionModel();
/* @var InfoBox $info */
$info = $this->found['info'];
- 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"