Showing 58 of 136 total issues
File diacritics.js
has 848 lines of code (exceeds 250 allowed). Consider refactoring. Open
define([
], function () {
var diacritics = {
'\u24B6': 'A',
Function onPagesInitialized
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
public function onPagesInitialized()
{
$page = $this->grav['page'];
$route = 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
Function exports
has 216 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
// Full list of files that must be included by RequireJS
includes = [
'jquery.select2',
'almond',
Function problemChecker
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
protected function problemChecker()
{
$min_php_version = defined('GRAV_PHP_MIN') ? GRAV_PHP_MIN : '5.4.0';
$problems_found = 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 bind
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
Results.prototype.bind = function (container, $container) {
var self = this;
var id = container.id + '-results';
File core.js
has 435 lines of code (exceeds 250 allowed). Consider refactoring. Open
define([
'jquery',
'./options',
'./utils',
'./keys'
Method problemChecker
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function problemChecker()
{
$min_php_version = defined('GRAV_PHP_MIN') ? GRAV_PHP_MIN : '5.4.0';
$problems_found = false;
Function checkForPermissions
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function checkForPermissions($collection)
{
$user = $this->grav['user'];
$returnCollection = new Collection();
foreach ($collection as $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
Function apply
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
Defaults.prototype.apply = function (options) {
options = $.extend(true, {}, this.defaults, options);
if (options.dataAdapter == null) {
if (options.ajax != null) {
File results.js
has 390 lines of code (exceeds 250 allowed). Consider refactoring. Open
define([
'jquery',
'./utils'
], function ($, Utils) {
function Results ($element, options, dataAdapter) {
Function notFound
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function notFound($query, $page, $taxonomies)
{
$searchable_types = ['title', 'content', 'taxonomy'];
$results = true;
$search_content = $this->config->get('plugins.simplesearch.search_content');
- 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 onPagesInitialized
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function onPagesInitialized()
{
$page = $this->grav['page'];
$route = null;
File defaults.js
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
define([
'jquery',
'./results',
Function renderProblems
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
protected function renderProblems()
{
$theme = 'antimatter';
/** @var Uri $uri */
- 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 bind
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Search.prototype.bind = function (decorated, container, $container) {
var self = this;
var resultsId = container.id + '-results';
var selectionId = container.id + '-container';
Function fromElement
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Options.prototype.fromElement = function ($e) {
var excludedData = ['select2'];
if (this.options.multiple == null) {
this.options.multiple = $e.prop('multiple');
Function _positionDropdown
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
AttachBody.prototype._positionDropdown = function () {
var $window = $(window);
var isCurrentlyAbove = this.$dropdown[0].classList
.contains('select2-dropdown--above');
Function _registerEvents
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Select2.prototype._registerEvents = function () {
var self = this;
this.on('open', function () {
self.$container[0].classList.add('select2-container--open');
File learn.js
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Scrollbar Width function
function getScrollBarWidth() {
var inner = document.createElement('p');
inner.style.width = "100%";
inner.style.height = "200px";
Function reset
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Defaults.prototype.reset = function () {
function stripDiacritics (text) {
// Used 'uni range + named function' from http://jsperf.com/diacritics/18
function match(a) {
return DIACRITICS[a] || a;