Showing 66 of 75 total issues
Function compile
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function compile()
{
$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
Method parseAttribute
has 45 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 handleSearchResults
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var handleSearchResults = function(searchResults, query) {
$(document).unbind('keydown');
$.each(searchResults, function (index, searchResult) {
resultsList.append('<li n="' + index + '" class="search-result"><a href="' + searchResult.link + '">' + searchResult.title + '</a></li>');
Method parse
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse($html)
{
$html = ltrim($html);
// Get token position.
Method symbolize
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function symbolize($data, AbstractPropertySymbol $parent = null, $name = null)
{
if (($parent === null)) {
// no parent, so create a root node
Function isClosingElementImplied
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function isClosingElementImplied($html)
{
$parent = $this->getParent();
if ($parent === null || !($parent instanceof self)) {
return false;
- 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 render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function render(SymbolCollection $symbols)
{
$rendered = '';
$symbolsIterator = $symbols->getIterator();
$symbolsIterator->rewind();
- 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 setDropdown
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setDropdown(select) {
var container = select.parent();
var svg = '<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g class="ht-select-button-icon"><path d="M2,3 L8,3 L5,7 L2,3 Z"></path></g></svg>';
var toggle = $('<a class="ht-select-button"><span>' + createOptionText(select.find('option:selected')) + '</span>' + svg + '</a>');
container.append(toggle);
Function toogleDropdown
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function toogleDropdown(container, open) {
if (open) {
$('body').bind('click', function (e) {
e.preventDefault();
if ($(e.target).is(container.find('*')))return;
Method parse
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse($html)
{
// Get token position.
$positionArray = ResourceTokenizer::getPosition($html);
Method __construct
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($throwOnError = false)
{
$this->throwOnError = (boolean) $throwOnError;
TokenFactory::clearMatchings();
Function resolvePropertyByReference
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function resolvePropertyByReference($reference)
{
if (strpos($reference, "../") === 0) {
- 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 parseContents
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function parseContents($html)
{
if (ltrim($html) == '') {
return '';
}
- 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 setDataStream
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setDataStream($dataStream)
{
// make sure, we will handle an object
if (empty($dataStream)) {
// create generic data object
Function initSearch
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initSearch() {
var debounce = function(func, wait) {
var timeout;
var result;
return function() {
Method parseContents
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseContents($html)
{
if (ltrim($html) == '') {
return '';
}
Function registerMatching
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function registerMatching($className, $regexStart = null, $regexEnd = null)
{
if (array_key_exists($className, self::$matchings)) {
throw new TokenFactoryException("Token has been registered already");
}
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function symbolize($data, AbstractPropertySymbol $parent = null, $name = null)
{
if (($parent === null)) {
// no parent, so create a root node
- 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 resolveFilepath
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function resolveFilepath($filename)
{
$themeId = $this->getThemeId();
$paths = $this->findThemePaths($themeId);
// finally add base/
- 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 parse
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function parse($html)
{
// Get token position.
$positionArray = ResourceTokenizer::getPosition($html);
$this->setLine($positionArray['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"