Showing 122 of 200 total issues
Function Enumerable
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
var Enumerable = (function () {
function each(iterator, context) {
try {
this._each(iterator, context);
} catch (e) {
- 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 matcherFromGroupMatchers
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcherFromGroupMatchers(elementMatchers, setMatchers) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function (seed, context, xml, results, outermost) {
var elem, j, matcher,
Method truncateHtml
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function truncateHtml(
string $text,
?int $length = null,
?string $ending = null,
?bool $exact = null,
Function setMatcher
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
if (postFilter && !postFilter[expando]) {
postFilter = setMatcher(postFilter);
}
if (postFinder && !postFinder[expando]) {
Function superMatcher
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
superMatcher = function (seed, context, xml, results, outermost) {
var elem, j, matcher,
matchedCount = 0,
i = "0",
unmatched = seed && [],
Function deleteDirectory
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function deleteDirectory($src)
{
// Only continue if user is a 'global' Admin
if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
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 CHILD
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
"CHILD": function (type, what, argument, first, last) {
var simple = type.slice(0, 3) !== "nth",
forward = type.slice(-4) !== "last",
ofType = what === "of-type";
Function Serializers
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Form.Element.Serializers = (function () {
function input(element, value) {
switch (element.type.toLowerCase()) {
case 'checkbox':
case 'radio':
Consider simplifying this complex logical expression. Open
if (forward && useCache) {
outerCache = parent[expando] || (parent[expando] = {});
cache = outerCache[type] || [];
nodeIndex = cache[0] === dirruns && cache[1];
diff = cache[0] === dirruns && cache[2];
Method xoops_module_update_moduleinstaller
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_moduleinstaller(\XoopsModule $module, $previousVersion = null)
{
$moduleDirName = \basename(\dirname(__DIR__));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Function Str
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Str(key, holder, stack) {
var value = holder[key];
if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
Function clonePosition
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function clonePosition(element, source, options) {
options = Object.extend({
setLeft: true,
setTop: true,
setWidth: true,
Function request
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
request: function (url) {
this.url = url;
this.method = this.options.method;
var params = Object.isString(this.options.parameters) ?
this.options.parameters :
- 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 setRequestHeaders
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
setRequestHeaders: function () {
var headers = {
'X-Requested-With': 'XMLHttpRequest',
'X-Prototype-Version': Prototype.Version,
'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
- 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 select
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
select = Sizzle.select = function (selector, context, results, seed) {
var i, tokens, token, type, find,
compiled = typeof selector === "function" && selector,
match = !seed && tokenize((selector = compiled.selector || selector));
Function tokenize
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tokenize(selector, parseOnly) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[selector + " "];
Function getPixelValue
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getPixelValue(value, property, context) {
var element = null;
if (Object.isElement(value)) {
element = value;
value = getRawStyle(element, property);
Function matcherFromTokens
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcherFromTokens(tokens) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[tokens[0].type],
implicitRelative = leadingRelative || Expr.relative[" "],
Function findDOMClass
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findDOMClass(tagName) {
var klass;
var trans = {
"OPTGROUP": "OptGroup",
"TEXTAREA": "TextArea",
Function _begin
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
_begin: function () {
if (this._isPrepared()) return;
var element = this.element;
if (isDisplayed(element)) {