Showing 66 of 75 total issues
Method getHTML401NamedToNumeric
has 255 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getHTML401NamedToNumeric()
{
return array(
' ' => ' ', // no-break space = non-breaking space, U+00A0 ISOnum
'¡' => '¡', // inverted exclamation mark, U+00A1 ISOnum
File theme.main.js
has 516 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function($) {
/**
*
* K15t Help Theme
* Main Javascript
Function toString
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
public function toString()
{
$attr = ($this->getAttributes());
- 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 toString
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function toString()
{
$EOL = $this->config()->EOL();
$attr = ($this->getAttributes());
- 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 Element.php
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace PHPagstract\Token\Tokens;
use PHPagstract\Token\MarkupTokenizer;
Function findThemePaths
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function findThemePaths($themeId, $result = [])
{
$themesDir = $this->getThemesDir();
$paths = scandir($themesDir);
- 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 setDataStream
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function setDataStream($dataStream)
{
// make sure, we will handle an object
if (empty($dataStream)) {
// create generic data object
- 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 PagstractAbstractToken.php
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Pagstract token abstract class
*/
namespace PHPagstract\Token\Tokens;
File PagstractSimpleValue.php
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* PHPagstract simple value reference token symbol class
*/
namespace PHPagstract\Symbol\Symbols\Tokens;
Method toString
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toString()
{
$attr = ($this->getAttributes());
Function buildFromHtml
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function buildFromHtml($html, Token $parent = null, $throwOnError = false)
{
$matchCriteria = self::getMatchings();
foreach ($matchCriteria as $className => $regex) {
if (preg_match($regex["start"], $html) === 1) {
- 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 symbolize
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function symbolize($token, $throwOnError = false)
{
// get token name "PagstactTokenName", fallback "PagstactMarkup" needed ?
$symbolName = ucfirst($token->getType());
- 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 isClosingElementImplied
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isClosingElementImplied($html)
{
$parent = $this->getParent();
if ($parent === null || !($parent instanceof self)) {
return false;
Function searchSetup
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
var searchSetup = function() {
var locationOrigin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
var pageLocation = locationOrigin + window.location.pathname;
var url = pageLocation.substr(0, pageLocation.lastIndexOf('/') + 1);
Function parseAttribute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function parseAttribute($html)
{
$remainingHtml = ltrim($html);
// Will match the first entire name/value attribute pair.
- 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 parseAttribute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function parseAttribute($html)
{
$remainingHtml = ltrim($html);
// Will match the first entire name/value attribute pair.
- 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 doSearch
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doSearch(query) {
var dropdown = $('.ht-search-input .ht-search-dropdown');
var resultsList = dropdown.find('ul');
resultsList.empty();
Method parse
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse($html)
{
$html = ltrim($html);
// Get token position.
Method parseAttribute
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseAttribute($html)
{
$remainingHtml = ltrim($html);
// Will match the first entire name/value attribute pair.
Function resolve
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function resolve($tokens)
{
$symbols = new SymbolCollection();
- 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"