Showing 290 of 2,627 total issues
File references_articles.php
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* ****************************************************************************
* references - MODULE FOR XOOPS
* Copyright (c) Hervé Thouzard of Instant Zero (http://www.instant-zero.com)
references_listFilter
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class references_listFilter
{
const FILTER_DATA_TEXT = 1;
const FILTER_DATA_NUMERIC = 2;
Function initialize
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
initialize: function (event, win) {
win = win || window;
var doc = win.document;
event = event || win.event;
if (event.$extended) return event;
- 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 doCall
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
private function doCall($url, array $parameters = null, $authenticate = false, $method = 'GET', $filePath = null, $expectJSON = true)
{
// allowed methods
$allowedMethods = array('GET', 'POST');
- 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 save
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function save($data, $id = null, $group = 'default')
{
if ($this->_caching) {
if ($this->_automaticSerialization) {
$data = serialize($data);
- 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 find
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
find: function (t, context) {
// Quickly handle non-string expressions
if (typeof t != "string")
return [t];
Function get
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function get($id, $group = 'default', $doNotTestCacheValidity = false)
{
$this->_id = $id;
$this->_group = $group;
$data = 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
Consider simplifying this complex logical expression. Open
if (typeof elem == "string") {
// Fix "XHTML"-style tags in all browsers
elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function (all, front, tag) {
return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
all :
Function getStyle
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
getStyle: function (property) {
switch (property) {
case 'opacity':
return this.get('opacity');
case 'float':
- 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 Cache
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.Autocompleter.Cache = function (options) {
var data = {};
var length = 0;
Function __construct
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null)
{
if ($mode === null) {
$mode = references_PEAR_ERROR_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 doCall
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doCall($url, array $parameters = null, $authenticate = false, $method = 'GET', $filePath = null, $expectJSON = true)
{
// allowed methods
$allowedMethods = array('GET', 'POST');
Function convertResultSet
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function convertResultSet($result, $id_as_key = false, $as_object = true, $fields = '*')
{
$ret = array();
while ($myrow = $this->db->fetchArray($result)) {
$obj =& $this->create(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
Consider simplifying this complex logical expression. Open
if ((type == "" && !!z ||
type == "=" && z == m[5] ||
type == "!=" && z != m[5] ||
type == "^=" && z && !z.indexOf(m[5]) ||
type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
Method insert
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insert(XoopsObject $obj, $force = false, $checkObject = true, $ignoreInsert = false)
{
if ($checkObject != false) {
if (!is_object($obj)) {
trigger_error('Error, not object');
Function createThumb
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public static function createThumb($src_path, $dst_path, $param_width, $param_height, $keep_original = false, $fit = 'inside')
{
// require_once self::MODULE_PATH . 'class/wideimage/WideImage.php';
$resize = true;
// On commence par vérifier que l'image originale n'est pas plus petite que les dimensions demandées auquel cas il n'y a rien à faire
- 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 Native
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
var Native = function (options) {
options = options || {};
var name = options.name;
var legacy = options.legacy;
var protect = options.protect;
- 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 uploadFile
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function uploadFile($indice, $dstpath = XOOPS_UPLOAD_PATH, $mimeTypes = null, $uploadMaxSize = null, $maxWidth = null, $maxHeight = null)
{
require_once XOOPS_ROOT_PATH . '/class/uploader.php';
global $destname;
if (isset($_POST['xoops_upload_file'])) {
- 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 toArray
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function toArray($format = 's')
{
$ret = array();
$ret = parent::toArray($format);
$hrefTitle = $this->getHrefTitle();
- 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 filter
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
filter: function (t, r, not) {
var last;
// Look for common filter expressions
while (t && t != last) {