ctrl-f5/ctrl-common

View on GitHub

Showing 29 of 38 total issues

Method tokenize has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function tokenize(array $expressions)
    {
        $tokens = array();

        foreach ($expressions as $expr) {
Severity: Minor
Found in src/Criteria/Resolver.php - About 1 hr to fix

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

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $c = $this->getContainer();
    
            if ($c->getParameter('database_driver') !== 'pdo_mysql') {
    Severity: Minor
    Found in src/Command/DatabaseImportCommand.php - About 1 hr to fix

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

          protected function parseLines(array $lines = array())
          {
              $parsed = [];
              foreach ($lines as $line) {
                  $data = [];
      Severity: Minor
      Found in src/Log/Parser.php - About 1 hr to fix

        Method test_resolve_string has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function test_resolve_string()
            {
                $resolver = $this->getResolver('root');
        
                $result = $resolver->resolveCriteria('id = 1');
        Severity: Minor
        Found in test/EntityService/Criteria/ResolverTest.php - About 1 hr to fix

          Method test_unpack has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function test_unpack()
              {
                  $result = StringHelper::bracesToArray('test');
                  self::assertEquals(['test'], $result);
          
          
          Severity: Minor
          Found in test/Tools/StringHelperTest.php - About 1 hr to fix

            Function getFilterRegex has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getFilterRegex()
                {
                    $filter = [
                        'date'          => '',
                        'logger.level'  => '',
            Severity: Minor
            Found in src/Log/Parser.php - About 45 mins 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 parseLines has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function parseLines(array $lines = array())
                {
                    $parsed = [];
                    foreach ($lines as $line) {
                        $data = [];
            Severity: Minor
            Found in src/Log/Parser.php - About 35 mins 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

            Avoid too many return statements within this method.
            Open

                        return $expr;
            Severity: Major
            Found in src/Criteria/Adapter/DoctrineAdapter.php - About 30 mins to fix

              Function configureFromRequestParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function configureFromRequestParams($request)
                  {
                      $page = 1;
                      $pageSize = $this->pageSize;
              
              
              Severity: Minor
              Found in src/Paginator/DoctrinePaginator.php - About 25 mins 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

              Severity
              Category
              Status
              Source
              Language