Showing 701 of 9,653 total issues
Avoid deeply nested control flow statements. Open
if ($helper->getConfig('watermark_text') != $_POST['watermark_text']) {
$criteria = new \CriteriaCompo();
$criteria->add($moduleIdCriteria);
$criteria->add(new \Criteria('conf_name', 'watermark_text'));
$config = $configHandler->getConfigs($criteria);
Function loadExtension
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function loadExtension($ext)
{
if (extension_loaded($ext)) {
return true;
}
- 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 _multipleToStruct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected static function _multipleToStruct($files)
{
$struct = ['dirs' => [], 'files' => []];
$files = (array)$files;
foreach ($files as $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 toString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function toString()
{
$modes = [];
$levels = [
E_USER_NOTICE => 'notice',
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($title, $modid, $permname, $permdesc, $url = '', $anonymous = true)
Method addLocalPhoto
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$catId,
$dirtyPhotoName,
$photoTitle = '',
$photoDesc = '',
$photoExtra = '',
Function getCatRestrictCriteria
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getCatRestrictCriteria($permType = 'public_access')
{
if (null !== $GLOBALS['xoopsUser'] && \is_object($GLOBALS['xoopsUser'])) {
$permHandler = $this->getPermHandler();
$allowedCategories = $permHandler->getAuthorizedPublicCat($GLOBALS['xoopsUser'], $permType);
- 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
} else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
e.preventDefault();
$.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
}
Consider simplifying this complex logical expression. Open
if ('' != $opt_rest && '=' != $opt[0]
&& $i + 1 < count($long_options)
&& $opt == substr($long_options[$i + 1], 0, $opt_len)
&& '' != $next_option_rest
&& '=' != $next_option_rest[0]) {
Function galleria
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
galleria: function (_, t, b, c, d) {
Function complete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var complete = (function( data, next, active, queue, thumb ) {
Function galleria
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
galleria: function (_, t, b, c, d) {
Function galleria
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
galleria: function (_, t, b, c, d) {
Function complete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var complete = (function( data, next, active, queue, thumb ) {
Function easing
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easing: function(x,t,b,c,d) {
Function easeout
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
this.easeout = function (x, t, b, c, d) {
Function easeInQuad
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInQuad: function (x, t, b, c, d) {
Function galleriaOut
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
galleriaOut: function (_, t, b, c, d) {
Function easeOutQuad
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutQuad: function (x, t, b, c, d) {
Function galleriaIn
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
galleriaIn: function (_, t, b, c, d) {