Showing 24 of 24 total issues
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;
Epic
has 56 functions (exceeds 20 allowed). Consider refactoring. Open
Open
final class Epic implements ComponentResponseBody, CreateableComponent, UpdateableComponent
{
private string $appUrl;
private bool $archived = false;
File Epic.php
has 441 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types = 1);
namespace LarsNieuwenhuizen\ClubhouseConnector\Component\Epics\Domain\Model;
Milestone
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
Open
final class Milestone implements ComponentResponseBody, UpdateableComponent, CreateableComponent
{
private string $appUrl;
private array $categories = [];
Project
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
Open
final class Project implements ComponentResponseBody, UpdateableComponent, CreateableComponent
{
private int $id;
Method createFromResponseData
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function createFromResponseData(array $values): Epic
{
$object = new static();
$object->appUrl = $values['app_url'];
$object->archived = $values['archived'];
File Milestone.php
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types = 1);
namespace LarsNieuwenhuizen\ClubhouseConnector\Component\Milestones\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'];
File Project.php
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace LarsNieuwenhuizen\ClubhouseConnector\Component\Projects\Domain\Model;
Method createFromResponseData
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function createFromResponseData(array $values): Milestone
{
$object = new static();
$object->appUrl = $values['app_url'];
$object->categories = $values['categories'] ?? [];
Method toArrayForUpdate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function toArrayForUpdate(): array
{
$data = [
'name' => $this->getName(),
'archived' => $this->getArchived(),
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 toArrayForCreation
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function toArrayForCreation(): array
{
$data = [
'name' => $this->getName(),
'deadline' => null,
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(),
Method update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function update(UpdateableComponent $component): ComponentResponseBody
{
if (!$component instanceof $this->componentClass) {
$message = 'The object you are trying to update of type ' .
\get_class($component) . ' is not a ' . $this->componentName;
Method create
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function create(CreateableComponent $component): ComponentResponseBody
{
if (!$component instanceof $this->componentClass) {
$message = 'The object you are trying to create of type ' . \get_class($component) . ' is not a milestone.';
$this->getLogger()->error($message);
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 toArrayForUpdate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public function toArrayForUpdate(): array
{
$data = [
'name' => $this->getName(),
'archived' => $this->getArchived(),
- 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"