Showing 316 of 1,631 total issues
File Parsedown.php
has 1193 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Parsedown;
#
#
# Parsedown
File Core.php
has 843 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
if (!defined('ENT_SUBSTITUTE')) {
// use 0 as hhvm does not support several flags yet
define('ENT_SUBSTITUTE', 0);
Function getAttribute
has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring. Open
protected function getAttribute($object, $item, array $arguments = array(), $type = self::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false)
{
// array
if (self::METHOD_CALL !== $type) {
$arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item;
- 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 Environment.php
has 713 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of Twig.
*
Twig_Environment
has 72 functions (exceeds 20 allowed). Consider refactoring. Open
class Twig_Environment
{
const VERSION = '1.24.1';
protected $charset;
File Parser.php
has 599 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Jade;
use Jade\Parser\Exception as ParserException;
Function lines
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
protected function lines(array $lines)
{
$CurrentBlock = null;
foreach ($lines as $line)
- 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 ExpressionParser.php
has 495 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of Twig.
*
Function getArguments
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
protected function getArguments($callable, $arguments)
{
$callType = $this->getAttribute('type');
$callName = $this->getAttribute('name');
- 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
Parsedown
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
class Parsedown
{
# ~
const version = '1.6.0';
Function findFileWithExtension
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
- 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 doIntegrationTest
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
protected function doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs)
{
if ($condition) {
eval('$ret = '.$condition.';');
if (!$ret) {
- 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
Parser
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
class Parser
{
public static $includeNotFound = ".alert.alert-danger.\n\tPage not found.";
protected $allowMixedIndent;
Function tag
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
protected function tag($tag)
{
$tag->line = $this->line();
while (true) {
- 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 parseSubscriptExpression
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function parseSubscriptExpression($node)
{
$stream = $this->parser->getStream();
$token = $stream->next();
$lineno = $token->getLine();
- 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 getAttribute
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAttribute($object, $item, array $arguments = array(), $type = self::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false)
{
// array
if (self::METHOD_CALL !== $type) {
$arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item;
Function guessTemplateInfo
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
protected function guessTemplateInfo()
{
$template = null;
$templateClass = 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 lines
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function lines(array $lines)
{
$CurrentBlock = null;
foreach ($lines as $line)
Function parseArguments
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function parseArguments($namedArguments = false, $definition = false)
{
$args = array();
$stream = $this->parser->getStream();
- 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 compileConstructor
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function compileConstructor(Twig_Compiler $compiler)
{
$compiler
->write("public function __construct(Twig_Environment \$env)\n", "{\n")
->indent()