Function interpolateTwigFunctions
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
protected function interpolateTwigFunctions(string $code): string
{
$tokens = array_slice(token_get_all('<?php '.$code), 1);
$output = '';
$count = count($tokens);
File HelpersHandler.php
has 273 lines of code (exceeds 250 allowed). Consider refactoring.
<?php
declare(strict_types=1);
namespace Pug\Symfony\Traits;
Method interpolateTwigFunctions
has 60 lines of code (exceeds 25 allowed). Consider refactoring.
protected function interpolateTwigFunctions(string $code): string
{
$tokens = array_slice(token_get_all('<?php '.$code), 1);
$output = '';
$count = count($tokens);
Method getRendererOptions
has 45 lines of code (exceeds 25 allowed). Consider refactoring.
protected function getRendererOptions(): array
{
if ($this->options === null) {
$environment = $this->kernel->getEnvironment();
$projectDirectory = $this->kernel->getProjectDir();
Function copyTwigFunctions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
protected function copyTwigFunctions(): void
{
$this->twigHelpers = [];
$twig = $this->getTwig();
$twig->env = $twig;
Method copyTwigFunctions
has 33 lines of code (exceeds 25 allowed). Consider refactoring.
protected function copyTwigFunctions(): void
{
$this->twigHelpers = [];
$twig = $this->getTwig();
$twig->env = $twig;
Function getRendererOptions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
protected function getRendererOptions(): array
{
if ($this->options === null) {
$environment = $this->kernel->getEnvironment();
$projectDirectory = $this->kernel->getProjectDir();
Avoid deeply nested control flow statements.
switch ($tokens[$index]) {
case '(':
$opening++;
$argumentNeedInterpolation = true;
$argument .= '(';
The method interpolateTwigFunctions() has a Cyclomatic Complexity of 18. The configured cyclomatic complexity threshold is 10.
protected function interpolateTwigFunctions(string $code): string
{
$tokens = array_slice(token_get_all('<?php '.$code), 1);
$output = '';
$count = count($tokens);
The method getRendererOptions() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
protected function getRendererOptions(): array
{
if ($this->options === null) {
$environment = $this->kernel->getEnvironment();
$projectDirectory = $this->kernel->getProjectDir();
Avoid assigning values to variables in if clauses and the like (line '88', column '18').
protected function getRendererOptions(): array
{
if ($this->options === null) {
$environment = $this->kernel->getEnvironment();
$projectDirectory = $this->kernel->getProjectDir();
Avoid assigning values to variables in if clauses and the like (line '89', column '26').
protected function getRendererOptions(): array
{
if ($this->options === null) {
$environment = $this->kernel->getEnvironment();
$projectDirectory = $this->kernel->getProjectDir();
syntax error, unexpected 'ContainerInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
protected ContainerInterface $container;
Avoid excessively long variable names like $argumentNeedInterpolation. Keep variable name length under 20.
$argumentNeedInterpolation = false;
Avoid excessively long variable names like $argumentNeedInterpolation. Keep variable name length under 20.
protected function pushArgument(array &$arguments, string &$argument, bool &$argumentNeedInterpolation): void
Space before opening parenthesis of function call prohibited
static fn ($path) => $path !== $baseDir,
Line indented incorrectly; expected 12 spaces, found 16
static fn ($path) => $path !== $baseDir,
There are no issues that match your filters.