Showing 78 of 223 total issues
Method checkCadetAdvStep1
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkCadetAdvStep1(Mission $model)
{
$step = $model->steps[0];
$this->assertInstanceOf(MissionStep::class, $step);
$this->assertCount(1, $step->skills);
- Create a ticketCreate a ticket
Method checkCadetStep5
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkCadetStep5(Mission $model)
{
$step = $model->steps[4];
$this->assertInstanceOf(MissionStep::class, $step);
$this->assertCount(1, $step->skills);
- Create a ticketCreate a ticket
Method testRateStepCadet
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testRateStepCadet()
{
$analyst
= new Analyst($this->wiki->missions(), $this->wiki->crew());
- Create a ticketCreate a ticket
Method checkCadetAdvStep5
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkCadetAdvStep5(Mission $model)
{
$step = $model->steps[4];
$this->assertInstanceOf(MissionStep::class, $step);
$this->assertCount(1, $step->skills);
- Create a ticketCreate a ticket
Function stepBestCrew
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function stepBestCrew(
MissionStep $step,
int $idxStep,
int $idxMission,
int $idxEpisode,
- 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 stepBestCrew
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
MissionStep $step,
int $idxStep,
int $idxMission,
int $idxEpisode,
string $type
- Create a ticketCreate a ticket
Function stats
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function stats(CrewMember $member)
{
foreach ($member->skills as $skill => $val) {
if (empty($val)) {
continue;
- 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 parseMWHead
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function parseMWHead(string $head): array
{
$lines = explode("\n", $head);
$intro = [];
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
public function parse(): array
{
parent::parse();
$mission = [];
- 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 get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function get(string $what = null): array
{
if ($this->models) {
return empty($what) ? $this->models : $this->models[$what];
}
- 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 dehydrate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function dehydrate(&$title, &$value): void
{
$trim = "{}[] \t\r\n\xb\0";
$title = trim(strtolower($title), $trim);
switch ($title) {
- 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
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket
Function mapMissionAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function mapMissionAttributes(array $missions): array
{
$ret = [];
foreach ($missions as $mission) {
if (empty($mission['steps'])) {
- 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 offsetSet
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function offsetSet($offset, $value)
{
switch (strtolower($offset)) {
case 'crewname':
list($this->name, $this->page) = $this->parseName($value);
- 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 fetchCadetCrew
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function fetchCadetCrew(array $names, array $cadet)
{
foreach ($cadet as $episode => $missions) {
$this->parse->page($names[$episode], 2);
preg_match_all(
- 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 canUnlock
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function canUnlock(MissionStep $step): bool
{
foreach ($step->locks as $lock) {
if (empty($lock)) {
continue;
- 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 each
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function each(callable $func): void
{
foreach ($this->list as $type => $episodes) {
foreach ($episodes as $episode => $missions) {
foreach ($missions as $index => $mission) {
- 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 parseMissions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function parseMissions(array $missions, string $episode): array
{
$info = [];
$adv = 'adv:' == strtolower(substr($episode, 0, 4));
foreach ($missions as $mission) {
- 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"