Showing 58 of 136 total issues
Function query
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tokenizer.prototype.query = function (decorated, params, callback) {
var self = this;
function createAndSelect (data) {
// Normalize the data object so we can use it for checks
Function highlight
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.fn.highlight = function(words, options) {
var settings = {
className: 'highlight',
element: 'span',
caseSensitive: false,
Function option
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
SelectAdapter.prototype.option = function (data) {
var option;
if (data.children) {
option = document.createElement('optgroup');
Function select
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
SelectAdapter.prototype.select = function (data) {
var self = this;
data.selected = true;
Function _processTranslations
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Defaults.prototype._processTranslations = function (languages, debug) {
var translations = new Translation();
for (var l = 0; l < languages.length; l++) {
var languageData = new Translation();
Function select2
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.select2 = function (options) {
options = options || {};
if (typeof options === 'object') {
this.each(function () {
Function bind
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
StopPropagation.prototype.bind = function (decorated, container, $container) {
decorated.call(this, container, $container);
var stoppedEvents = [
'blur',
Function bind
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
EventRelay.prototype.bind = function (decorated, container, $container) {
var self = this;
var relayEvents = [
'open', 'opening',
'close', 'closing',
Function bind
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
StopPropagation.prototype.bind = function (decorated, container, $container) {
decorated.call(this, container, $container);
var stoppedEvents = [
'blur',
Function highlight
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
highlight: function(node, re, nodeName, className) {
if (node.nodeType === 3) {
var match = node.data.match(re);
if (match) {
var highlight = document.createElement(nodeName || 'span');
- 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 onPluginsInitialized
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function onPluginsInitialized()
{
if ($this->isAdmin()) {
$this->active = false;
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
Function build
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function build()
{
$hierarchy = array();
$grav = Grav::instance();
$current = $grav['page'];
- 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 function. Open
return null;
Avoid too many return
statements within this function. Open
return method;
Avoid too many return
statements within this function. Open
return matches[1];
Avoid too many return
statements within this function. Open
return computedStyle.width;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return null;