CPS-IT/handlebars

View on GitHub

Showing 13 of 13 total issues

Function resolveHelperFunction has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

protected function resolveHelperFunction($function): callable
{
// Try to resolve the Helper function in this order:
//
// 1. callable
Severity: Minor
Found in Classes/Traits/HandlebarsHelperTrait.php - About 2 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php
 
declare(strict_types=1);
 
/*
Severity: Major
Found in Classes/Event/AfterRenderingEvent.php and 1 other location - About 2 hrs to fix
Classes/Event/BeforeRenderingEvent.php on lines 1..87

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php
 
declare(strict_types=1);
 
/*
Severity: Major
Found in Classes/Event/BeforeRenderingEvent.php and 1 other location - About 2 hrs to fix
Classes/Event/AfterRenderingEvent.php on lines 1..78

Method resolveHelperFunction has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

protected function resolveHelperFunction($function): callable
{
// Try to resolve the Helper function in this order:
//
// 1. callable
Severity: Minor
Found in Classes/Traits/HandlebarsHelperTrait.php - About 1 hr to fix

    Method validateConfiguration has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    private function validateConfiguration(array $configuration): void
    {
    if (!isset($configuration['controller']) || (string)$configuration['controller'] === '') {
    throw new \InvalidArgumentException(
    \sprintf('An extbase controller must be configured for the "%s" compatibility layer.', self::TYPE),

      Method getConfigTreeBuilder has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      public function getConfigTreeBuilder(): TreeBuilder
      {
      $treeBuilder = new TreeBuilder('handlebars');
      $rootNode = $treeBuilder->getRootNode();
       
       
      Severity: Minor
      Found in Classes/DependencyInjection/Extension/Configuration.php - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        <?php
         
        declare(strict_types=1);
         
        /*
        Severity: Major
        Found in Classes/Exception/TemplateNotFoundException.php and 1 other location - About 1 hr to fix
        Classes/Exception/InvalidTemplateFileException.php on lines 1..51

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        <?php
         
        declare(strict_types=1);
         
        /*
        Severity: Major
        Found in Classes/Exception/InvalidTemplateFileException.php and 1 other location - About 1 hr to fix
        Classes/Exception/TemplateNotFoundException.php on lines 1..51

        Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        CacheInterface $cache,
        EventDispatcherInterface $eventDispatcher,
        TemplateResolverInterface $templateResolver,
        TemplateResolverInterface $partialResolver = null,
        array $defaultData = []
        Severity: Minor
        Found in Classes/Renderer/HandlebarsRenderer.php - About 35 mins to fix

          Function validateConfiguration has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          private function validateConfiguration(array $configuration): void
          {
          if (!isset($configuration['controller']) || (string)$configuration['controller'] === '') {
          throw new \InvalidArgumentException(
          \sprintf('An extbase controller must be configured for the "%s" compatibility layer.', self::TYPE),

          Function resolveTemplatePath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          public function resolveTemplatePath(string $templatePath): string
          {
          $filename = $templatePath;
          foreach (array_reverse($this->templateRootPaths) as $templateRootPath) {
          foreach ($this->supportedFileExtensions as $extension) {
          Severity: Minor
          Found in Classes/Renderer/Template/HandlebarsTemplateResolver.php - About 35 mins to fix

          Function process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          public function process(ContainerBuilder $container): void
          {
          $container->registerForAutoconfiguration(DataProcessorInterface::class)->addTag($this->processorTagName);
           
          foreach ($container->findTaggedServiceIds($this->processorTagName) as $id => $tags) {
          Severity: Minor
          Found in Classes/DependencyInjection/DataProcessorPass.php - About 35 mins to fix

          Avoid too many return statements within this method.
          Open

          return $callable;
          Severity: Major
          Found in Classes/Traits/HandlebarsHelperTrait.php - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language