src/Component/Stories/Domain/Model/Story.php
Story
has 106 functions (exceeds 20 allowed). Consider refactoring. Open
Open
final class Story implements ComponentResponseBody, UpdateableComponent, CreateableComponent
{
const STORY_TYPE_CHORE = 'chore';
const STORY_TYPE_BUG = 'bug';
File Story.php
has 709 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types = 1);
namespace LarsNieuwenhuizen\ClubhouseConnector\Component\Stories\Domain\Model;
Method createFromResponseData
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function createFromResponseData(array $values): Story
{
$object = new static();
$object->appUrl = $values['app_url'];
$object->archived = $values['archived'];
Method toArrayForCreation
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function toArrayForCreation(): array
{
$data = [
'archived' => $this->getArchived(),
'comments' => $this->getComments(),
Method toArrayForUpdate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function toArrayForUpdate(): array
{
$data = [
'archived' => $this->getArchived(),
'description' => $this->getDescription(),
Function createFromResponseData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function createFromResponseData(array $values): Story
{
$object = new static();
$object->appUrl = $values['app_url'];
$object->archived = $values['archived'];
- Read upRead up
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 toArrayForBulkUpdate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function toArrayForBulkUpdate()
{
$data = [
'archived' => $this->getArchived(),
'epic_id' => $this->getEpicId(),
Function toArrayForBulkUpdate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public function toArrayForBulkUpdate()
{
$data = [
'archived' => $this->getArchived(),
'epic_id' => $this->getEpicId(),
- Read upRead up
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"