Showing 42 of 56 total issues
AbstractValue
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractValue extends ValueFriends {
/** @const string Name of Primi (object) type. */
public const TYPE = '__undefined__';
File Repl.php
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Smuuf\Primi;
Function autocomplete
has a Cognitive Complexity of 23 (exceeds 8 allowed). Consider refactoring. Open
private static function autocomplete(
string $buffer,
Context $ctx
): array {
- 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
File StringTypeExtension.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Smuuf\Primi\Stdlib\TypeExtensions;
Function execute
has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring. Open
public function execute(): void {
$cfg = $this->config;
// Enable verbose logging.
- 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
Func
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Func {
/**
* Pair of regexes to match zeroes at the beginning and at the end of a
* string, if they're not the last zeroes on that side of decimal point.
Context
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Context {
use StrictObject;
/** Runtime config bound to this context. */
Function loop
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
private function loop(Context $ctx): void {
// Print out level (current frame's index in call stack).
if (!self::$noExtras) {
$level = self::getStackLevel($ctx);
- 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 mapping_to_couples
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
public static function mapping_to_couples(AbstractValue $value) {
$internalValue = $value->getCoreValue();
if ($internalValue instanceof MapContainer) {
- 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 loop
has 61 lines of code (exceeds 40 allowed). Consider refactoring. Open
private function loop(Context $ctx): void {
// Print out level (current frame's index in call stack).
if (!self::$noExtras) {
$level = self::getStackLevel($ctx);
Method execute
has 60 lines of code (exceeds 40 allowed). Consider refactoring. Open
public function execute(): void {
$cfg = $this->config;
// Enable verbose logging.
Function prepareParameters
has a Cognitive Complexity of 17 (exceeds 8 allowed). Consider refactoring. Open
public static function prepareParameters(array $paramsNode): array {
// Prepare dict array for passing specifics about parameters expected
// by the function.
// Parameters will be prepared as a dict array with names of parameters
- 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 check_allowed_parameter_types_of_function
has a Cognitive Complexity of 16 (exceeds 8 allowed). Consider refactoring. Open
public static function check_allowed_parameter_types_of_function(
\ReflectionFunction $rf
): array {
$types = [];
- 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 format
has 47 lines of code (exceeds 40 allowed). Consider refactoring. Open
#[PrimiFunc]
public static function format(
StringValue $str,
AbstractValue ...$items
): StringValue {
Function range
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
#[PrimiFunc(callConv: PrimiFunc::CONV_CALLARGS)]
public static function range(CallArgs $args): IteratorFactoryValue {
$args = $args->extract(['start', 'end', 'step'], ['end', 'step']);
- 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 extractMethods
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
public static function extractMethods(object $obj): array {
$result = [];
$extRef = new \ReflectionClass($obj);
- 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 handle
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
protected static function handle(array $node, Context $context) {
if (!\array_key_exists('args', $node)) {
return [];
}
- 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 prepareParameters
has 46 lines of code (exceeds 40 allowed). Consider refactoring. Open
public static function prepareParameters(array $paramsNode): array {
// Prepare dict array for passing specifics about parameters expected
// by the function.
// Parameters will be prepared as a dict array with names of parameters
Method range
has 46 lines of code (exceeds 40 allowed). Consider refactoring. Open
#[PrimiFunc(callConv: PrimiFunc::CONV_CALLARGS)]
public static function range(CallArgs $args): IteratorFactoryValue {
$args = $args->extract(['start', 'end', 'step'], ['end', 'step']);
Method build
has 42 lines of code (exceeds 40 allowed). Consider refactoring. Open
public static function build(
array $entryNode,
string $definitionName,
ModuleValue $definitionModule,
?array $defParams = \null,