Showing 14 of 26 total issues
Method __construct
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(
private DirInterface $specDir,
private DirInterface $outputDir,
private RouterInterface $router
) {
Method withMakeTranslation
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function withMakeTranslation(string $locale, string $domain): self
{
$new = clone $this;
$new->handleLocale($locale);
$new->localeSourceDir->assertExists();
Method breadcrumbObject
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function breadcrumbObject(object $var): void
{
$this->breadcrumb = $this->breadcrumb
->withAddedItem('object: ' . $var::class);
$objectKey = $this->breadcrumb->pos();
Method __construct
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(
private string $route
) {
$std = new StrictStd();
$this->data = $std->parse($this->route)[0];
Method withScanFor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function withScanFor(DirInterface $sourceDir): self
{
$new = clone $this;
$sourceDir->assertExists();
$new->sourceDir = $sourceDir;
Method streamTemp
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function streamTemp(string $content = ''): StreamInterface
{
$stream = 'php://temp';
try {
Function runCallableAt
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function runCallableAt(int $pos): void
{
$callable = $this->benchmark->callables()->get($pos);
$name = $this->benchmark->index()->get($pos);
for ($i = 0; $i < $this->times; ++$i) {
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
MessageInterface $message,
int $code = 0,
int $severity = E_ERROR,
string $filename = __FILE__,
int $lineno = __LINE__,
Function withMerge
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function withMerge(DependenciesInterface $dependencies): DependenciesInterface
{
$new = clone $this;
foreach ($dependencies->getIterator() as $name => $className) {
if ($new->keys->contains($name)) {
- 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 assertNoConflict
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function assertNoConflict(RouteEndpointInterface $endpoint): void
{
if (!isset($this->firstEndpoint)) {
$this->firstEndpoint = $endpoint;
} else {
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function run(string $anchor, &$argument): void
{
$queue = $this->plugsQueue->toArray()[$anchor] ?? [];
$gettype = $this->getType($argument);
$type = new Type($gettype);
- 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 __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(
private DirInterface $specDir,
private DirInterface $outputDir,
private RouterInterface $router
) {
- 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 withDependencies
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function withDependencies(object ...$namedDependencies): static
{
$new = clone $this;
$missing = [];
$new->dependencies ??= $new->getDependencies();
- 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 withAddedEndpoint
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function withAddedEndpoint(RouteEndpointInterface $endpoint): RouteInterface
{
$new = clone $this;
$new->assertUnique($endpoint);
$new->assertNoConflict($endpoint);
- 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"