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) {
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') {
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 = [];
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');
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);
Function getFilterRegex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getFilterRegex()
{
$filter = [
'date' => '',
'logger.level' => '',
- 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 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 = [];
- 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
Avoid too many return
statements within this method. Open
return $expr;
Function configureFromRequestParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function configureFromRequestParams($request)
{
$page = 1;
$pageSize = $this->pageSize;
- 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"