Showing 78 of 223 total issues
Method checkExportedMissionSteps
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkExportedMissionSteps(array $mission)
{
$this->assertArrayHasKey(
'steps',
$mission,
- Create a ticketCreate a ticket
Function fetchImages
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function fetchImages(array $missions): void
{
foreach ($missions as $mission) {
$mission = $mission->get();
$mission->image = $this->query->imageInfo(
- 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 flattenSteps
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function flattenSteps(array &$mission): void
{
foreach ($mission['steps'] as &$step) {
if (empty($step['locks'])) {
unset($step['locks']);
- 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 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function stepBestCrew(
MissionStep $step,
int $idxStep,
int $idxMission,
int $idxEpisode,
- Create a ticketCreate a ticket
Method createModel
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createModel(): MissionModel
{
$model = new MissionModel();
/* @var InfoBox $info */
$info = $this->found['info'];
- Create a ticketCreate a ticket
Method testModel
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testModel()
{
$this->assertSame('Changeling Bashir', static::$model['name']);
$this->assertSame('Changeling Bashir', static::$model['CrewName']);
$this->assertSame('Changeling%20Bashir', static::$model->uri());
- Create a ticketCreate a ticket
Method testExportedCharacters
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testExportedCharacters(array $exported)
{
$this->assertSame(
count(static::$wiki->crew()->get()),
count($exported['crew'])
- Create a ticketCreate a ticket
Function fetchPictures
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function fetchPictures(array $crew): array
{
if (empty($this->query)) {
return $crew;
}
- 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 validate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function validate(): bool
{
$result = true;
// validate cost
- 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 byName
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function byName(string $name, string $epName = null): ?MissionModel
{
$search = trim(strtolower($name));
$epSearch = trim(strtolower($epName));
foreach ($this->list as $episodes) {
- 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 testEpisodeMission
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testEpisodeMission()
{
// @codingStandardsIgnoreStart
$text
= <<<'EOT'
- Create a ticketCreate a ticket
Method checkCadetAdvStep4
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkCadetAdvStep4(Mission $model)
{
$step = $model->steps[3];
$this->assertInstanceOf(MissionStep::class, $step);
$this->assertCount(2, $step->skills);
- Create a ticketCreate a ticket
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