Showing 34 of 38 total issues
Function pack
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
public static function pack(Framework\ParticleInterface $particle): AbstractLoader
{
$obj = new OutgoingEdgeLoader($particle->getRegisteredOutgoingEdges());
foreach ($obj->cargo->classes as $class) {
$class = str_replace("ObjectOut", "ObjOut", $class); // for backwards-compatibility.
- 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 pack
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function pack(Framework\ParticleInterface $particle): AbstractLoader
{
$obj = new OutgoingEdgeLoader($particle->getRegisteredOutgoingEdges());
foreach ($obj->cargo->classes as $class) {
$class = str_replace("ObjectOut", "ObjOut", $class); // for backwards-compatibility.
Function probe
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function probe(): void
{
if(!isset($this->settings["constraints"]))
return;
$constraints = $this->settings["constraints"];
- 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 probe
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function probe(): void
{
if(!isset($this->settings["constraints"]))
return;
$constraints = $this->settings["constraints"];
Function header
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected static function header(EntityInterface $entity): array
{
error_log("calculating headers: ");
error_log(get_class($entity));
$first_hex = 11;
- 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 pack
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function pack(ParticleInterface $particle): AbstractLoader
{
$obj = new IncomingEdgeLoader($particle->getRegisteredIncomingEdges());
foreach($obj->cargo->classes as $class) {
$class = str_replace("ObjectOut", "ObjOut", $class); // for backwards-compatibility.
- 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 handle
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function handle(
ParticleInterface $particle,
array $pack,
string $name,
array $args // no use -yet-
Function in
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function in(ContextInterface $context): bool
{
/*
// would speed up, but not good for testing.
if($context instanceof Space)
- 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 pack
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function pack(ParticleInterface $particle): AbstractLoader
{
$obj = new IncomingEdgeLoader($particle->getRegisteredIncomingEdges());
foreach($obj->cargo->classes as $class) {
$class = str_replace("ObjectOut", "ObjOut", $class); // for backwards-compatibility.
Method fill
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function fill(array $args): AbstractEdge
{
if( count($this->fields)<=0 ) {
return $this;
}
Method switch
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function switch(string $name, array $args) /*: \Pho\Lib\Graph\EntityInterface*/
{
$method = function(string $key) {
return $this->adapters[$key] . "::handle";
};
Method header
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function header(EntityInterface $entity): array
{
error_log("calculating headers: ");
error_log(get_class($entity));
$first_hex = 11;
Function handle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function handle(
ParticleInterface $particle,
array $pack,
string $name,
array $args // no use -yet-
- 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 setup
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setup(string $type = "all"): AbstractEdge
{
$fields = function(): AbstractEdge
{
$this->fields = Loaders\FieldsLoader::fetchArray($this);
Function switch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function switch(string $name, array $args) /*: \Pho\Lib\Graph\EntityInterface*/
{
$method = function(string $key) {
return $this->adapters[$key] . "::handle";
};
- 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 getEdgeItself
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ParticleInterface $particle,
array $pack,
string $name,
Direction $direction,
bool $singular = false
Method saveField
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ParticleInterface $particle,
string $field_name,
/*mixed*/ $field_value,
bool $defer_persist,
FieldHelper $helper): void
Method checkEdgeNode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ParticleInterface $particle,
array $pack,
string $name,
ID $id,
Direction $direction
Method checkEdgeItself
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ParticleInterface $particle,
array $pack,
string $name,
ID $id,
Direction $direction
Method getEdgeNodes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ParticleInterface $particle,
array $pack,
string $name,
Direction $direction,
bool $singular = false