ctrl-f5/ctrl-rad-bundle

View on GitHub

Showing 20 of 20 total issues

Function getRows has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getRows()
    {
        $rows           = array();
        $columns        = $this->columns();
        $accessor       = PropertyAccess::createPropertyAccessor();
Severity: Minor
Found in TableView/TableBuilder.php - About 6 hrs to fix

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

TableBuilder has 34 functions (exceeds 20 allowed). Consider refactoring.
Open

class TableBuilder
{
    /**
     * @var string
     */
Severity: Minor
Found in TableView/TableBuilder.php - About 4 hrs to fix

    File TableBuilder.php has 305 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Ctrl\RadBundle\TableView;
    
    use Ctrl\Common\Paginator\PaginatedDataInterface;
    Severity: Minor
    Found in TableView/TableBuilder.php - About 3 hrs to fix

      Function execute has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function execute(Request $request, $id = null, array $context = array())
          {
              $options = $this->config->getOptions();
              $routes = $this->config->getRoutes();
              $config = $options['action_config'];
      Severity: Minor
      Found in Crud/Action/EditAction.php - About 2 hrs to fix

      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

      ConfigBuilder has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class ConfigBuilder
      {
          protected $config = array();
      
          protected $action = array();
      Severity: Minor
      Found in Crud/ConfigBuilder.php - About 2 hrs to fix

        Method getRows has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function getRows()
            {
                $rows           = array();
                $columns        = $this->columns();
                $accessor       = PropertyAccess::createPropertyAccessor();
        Severity: Major
        Found in TableView/TableBuilder.php - About 2 hrs to fix

          AbstractService has 21 functions (exceeds 20 allowed). Consider refactoring.
          Open

          abstract class AbstractService
          {
              /**
               * @var ObjectManager|EntityManager
               */
          Severity: Minor
          Found in EntityService/AbstractService.php - About 2 hrs to fix

            Method execute has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function execute(Request $request, $id = null, array $context = array())
                {
                    $options = $this->config->getOptions();
                    $routes = $this->config->getRoutes();
                    $config = $options['action_config'];
            Severity: Major
            Found in Crud/Action/EditAction.php - About 2 hrs to fix

              Method isType has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function isType($var, $type)
                  {
                      switch ($type) {
                          case 'bool':
                          case 'boolean':
              Severity: Minor
              Found in Twig/CtrlRadExtension.php - About 1 hr to fix

                Method execute has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function execute(Request $request)
                    {
                        $options = $this->config->getOptions();
                        $routes = $this->config->getRoutes();
                        $config = $this->config->getActionConfig();
                Severity: Minor
                Found in Crud/Action/IndexAction.php - About 1 hr to fix

                  Function isType has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function isType($var, $type)
                      {
                          switch ($type) {
                              case 'bool':
                              case 'boolean':
                  Severity: Minor
                  Found in Twig/CtrlRadExtension.php - About 1 hr to fix

                  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 createFilterCriteria has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function createFilterCriteria(FormInterface $form)
                      {
                          $criteria = array();
                  
                          /** @var FormInterface $child */
                  Severity: Minor
                  Found in Form/Traits/CreateFilterCriteria.php - About 1 hr to fix

                  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 execute has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function execute(InputInterface $input, OutputInterface $output)
                      {
                          $output->writeln("<error> you are about to do some stuff that requires sudo! </error>");
                  
                          $rootDir        = getcwd();
                  Severity: Minor
                  Found in Command/ApacheSetupCommand.php - About 1 hr to fix

                    Avoid too many return statements within this method.
                    Open

                                    return is_object($var) && $var instanceof \DateTime;
                    Severity: Major
                    Found in Twig/CtrlRadExtension.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return is_scalar($var);
                      Severity: Major
                      Found in Twig/CtrlRadExtension.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return is_numeric($var);
                        Severity: Major
                        Found in Twig/CtrlRadExtension.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return new RedirectResponse($this->router->generate(
                                          $context['route']['route'],
                                          $context['route']['params']
                                      ));
                          Severity: Major
                          Found in Crud/Action/EditAction.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return is_null($var);
                            Severity: Major
                            Found in Twig/CtrlRadExtension.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return $this->templating->renderResponse($config['template'], $viewVars);
                              Severity: Major
                              Found in Crud/Action/EditAction.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return is_object($var);
                                Severity: Major
                                Found in Twig/CtrlRadExtension.php - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language