Showing 88 of 88 total issues
File Template.php
has 1179 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of Fenom.
*
* (c) 2013 Ivan Shalganov
File Fenom.php
has 769 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of Fenom.
*
* (c) 2013 Ivan Shalganov
Function parseExpr
has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring. Open
public function parseExpr(Tokenizer $tokens, ?bool &$is_var = false): string
{
$exp = array();
$var = false; // last term was: true - variable, false - mixed
$op = false; // last exp was operator
- 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
File Compiler.php
has 631 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of Fenom.
*
* (c) 2013 Ivan Shalganov
Function parseTerm
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
public function parseTerm(Tokenizer $tokens, ?bool &$is_var = false, int $allows = -1): string
{
$is_var = false;
if ($tokens->is(Tokenizer::MACRO_UNARY)) {
$unary = $tokens->getAndNext();
- 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
Fenom
has 54 functions (exceeds 20 allowed). Consider refactoring. Open
class Fenom
{
const VERSION = '3.0';
const REV = 2;
/* Actions */
File Tokenizer.php
has 464 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of Fenom.
*
* (c) 2013 Ivan Shalganov
Compiler
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
class Compiler
{
/**
* Tag {include ...}
*
Template
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
class Template extends Render
{
const VAR_NAME = '$var';
const TPL_NAME = '$tpl';
Function parseVariable
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function parseVariable(Tokenizer $tokens, ?string $var = null): ?string
{
if (!$var) {
if ($tokens->isNext('@')) {
// $v = $tokens->get(T_VARIABLE);
- 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 parseTernary
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public function parseTernary(Tokenizer $tokens, $var, $is_var): string
{
$empty = $tokens->is('?');
$tokens->next();
if ($tokens->is(":", "?")) {
- 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 compile
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function compile()
{
$end = $pos = 0;
foreach ($this->_fenom->getPreFilters() as $filter) {
$this->_src = call_user_func($filter, $this, $this->_src);
- 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 parseQuote
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function parseQuote(Tokenizer $tokens): string
{
if ($tokens->is('"')) {
$stop = $tokens->current();
$_str = '"';
- 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
Method parseTerm
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseTerm(Tokenizer $tokens, ?bool &$is_var = false, int $allows = -1): string
{
$is_var = false;
if ($tokens->is(Tokenizer::MACRO_UNARY)) {
$unary = $tokens->getAndNext();
Function tagImport
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public static function tagImport(Tokenizer $tokens, Tag $tag): string
{
$tpl = $tag->tpl;
$import = array();
if ($tokens->is('[')) {
- 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
Tokenizer
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Tokenizer
{
const TOKEN = 0;
const TEXT = 1;
const WHITESPACE = 2;
Function __construct
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(string $query)
{
$this->_curr = null;
$this->_next = null;
$this->_prev = null;
- 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
Method parseExpr
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseExpr(Tokenizer $tokens, ?bool &$is_var = false): string
{
$exp = array();
$var = false; // last term was: true - variable, false - mixed
$op = false; // last exp was operator
Method compile
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compile()
{
$end = $pos = 0;
foreach ($this->_fenom->getPreFilters() as $filter) {
$this->_src = call_user_func($filter, $this, $this->_src);
Method __construct
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(string $query)
{
$this->_curr = null;
$this->_next = null;
$this->_prev = null;