Showing 21 of 69 total issues
Method install
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$installer = $setup;
$installer->startSetup();
State
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class State implements ProcessStateInterface
{
/**
* @var string
*/
File Drawer.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Created by PhpStorm.
* User: pandi
* Date: 25.07.16
Process
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Process implements ProcessProcessInterface
{
/**
* @var string
*/
Function gatherEvents
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function gatherEvents(\DOMElement $parentNode)
{
$events = [];
foreach ($this->getChildrenByName($parentNode, 'events') as $eventsNode) {
foreach ($this->getAllChildElements($eventsNode) as $eventNode) {
- 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
Function addEdgeEventText
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function addEdgeEventText(ProcessTransitionInterface $transition, array $label)
{
if ($transition->hasEvent()) {
$event = $transition->getEvent();
- 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
Function addEdgeAttributes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function addEdgeAttributes(ProcessTransitionInterface $transition, array $attributes, $label, $type = self::EDGE_FULL)
{
$attributes = array_merge($this->attributesTransition, $attributes);
$attributes['label'] = ' ' . $label;
- 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
Function drawTransitionsEvents
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function drawTransitionsEvents(ProcessStateInterface $state)
{
$events = $state->getEvents();
foreach ($events as $event) {
$transitions = $state->getOutgoingTransitionsByEvent($event);
- 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
Function gatherTransitions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function gatherTransitions(\DOMElement $parentNode)
{
$transitions = [];
foreach ($this->getChildrenByName($parentNode, 'transitions') as $transitionsNode) {
foreach ($this->getAllChildElements($transitionsNode) as $transitionNode) {
- 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 addEdge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addEdge(ProcessTransitionInterface $transition, $type = self::EDGE_FULL, $attributes = [], $fromName = null, $toName = null)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(GraphAdapterInterface $adapter, $name, array $attributes = [], $directed = true, $strict = true)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
\Dopamedia\StateMachine\Api\ProcessEventInterface $event,
\Dopamedia\StateMachine\Api\ProcessProcessInterface $process,
\Dopamedia\StateMachine\Api\ProcessStateInterface $state,
\Dopamedia\StateMachine\Api\ProcessTransitionInterface $transition,
\Dopamedia\StateMachine\Model\ConfigurationInterface $configuration
Function createEvents
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function createEvents($processName)
{
$eventMap = [];
if ($eventsConfiguration = $this->configuration->getEvents($processName)) {
- 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
Function getOutgoingTransitionsByEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getOutgoingTransitionsByEvent(ProcessEventInterface $event)
{
$transitions = [];
foreach ($this->outgoingTransitions as $transition) {
if ($transition->hasEvent()) {
- 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
Function getTimeoutEvents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getTimeoutEvents()
{
$events = [];
$transitions = $this->getOutgoingTransitions();
foreach ($transitions as $transition) {
- 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
Function hasOnEnterEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function hasOnEnterEvent()
{
$transitions = $this->getOutgoingTransitions();
foreach ($transitions as $transition) {
if ($transition->hasEvent()) {
- 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
Function getEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getEvent($eventName)
{
foreach ($this->outgoingTransitions as $transition) {
if ($transition->hasEvent()) {
$event = $transition->getEvent();
- 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
Function hasEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function hasEvent($id)
{
foreach ($this->outgoingTransitions as $transition) {
if ($transition->hasEvent()) {
$event = $transition->getEvent();
- 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
Function getOnEnterEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getOnEnterEvent()
{
$transitions = $this->getOutgoingTransitions();
foreach ($transitions as $transition) {
if ($transition->hasEvent()) {
- 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
Function getManualEvents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getManualEvents()
{
$manuallyExecutableEventList = [];
$transitions = $this->getAllTransitions();
foreach ($transitions as $transition) {
- 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"