Showing 272 of 370 total issues
Function SetFillColor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function SetFillColor($r,$g=-1,$b=-1)
{
//Set color for all filling operations
if(($r==0 && $g==0 && $b==0) || $g==-1)
$this->FillColor=sprintf('%.3f g',$r/255);
- 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 encoding
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function encoding(&$text, $in_charset)
{
$out_charset = $GLOBALS['valid_pfd_charset'];
if (empty($in_charset) || empty($out_charset) || !strcasecmp($out_charset, $in_charset)) 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 encoding
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function encoding(&$text, $in_charset)
{
$out_charset = $GLOBALS['valid_pfd_charset'];
if (empty($in_charset) || empty($out_charset) || !strcasecmp($out_charset, $in_charset)) 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 encoding
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function encoding(&$text, $in_charset)
{
$out_charset = $GLOBALS['valid_pfd_charset'];
if (empty($in_charset) || empty($out_charset) || !strcasecmp($out_charset, $in_charset)) 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 listNewLinks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function listNewLinks()
{
global $xoopsDB, $myts, $myCatTree, $xoopsModule;
// List links waiting for validation
$linkimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/images/shots/');
- 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 admin_refcheck
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function admin_refcheck($chkref = '')
{
if (empty($_SERVER['HTTP_REFERER'])) {
return true;
} else {
- 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 copy_templates_f2db
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function copy_templates_f2db($tplset_to, $whr_append = '1')
{
global $db;
// get tplsource
- 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 _renderOptionTree
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array())
{
$tree .= $prefix . "<input type=\"checkbox\" name=\"" . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" id=\"" . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" onclick=\"";
// If there are parent elements, add javascript that will
// make them selecteded when this element is checked to make
- 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 getTotalItems
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getTotalItems($sel_id = null, $status = '', $oper = '>')
{
$sel_id = filter_var($sel_id, FILTER_VALIDATE_INT, array('options' => array('default' => 0, 'min_range' => 0)));
$count = 0;
$arr = array();
- 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 b_mylinks_top_show
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function b_mylinks_top_show($options)
{
global $xoopsDB;
$block = array();
//ver2.5
- 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 _check
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function _check($from_lines, $to_lines)
{
if (serialize($from_lines) != serialize($this->getOriginal())) {
trigger_error("Reconstructed original doesn't match", E_USER_ERROR);
}
- 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 method. Open
return $Code;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return -2;
Avoid too many return
statements within this method. Open
return -1;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $this->Stack[$this->sp];
Function _encoding
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function _encoding(&$text, $in_charset, $out_charset)
{
$xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true);
if($xconv_handler &&
$converted_text = @$xconv_handler->convert_encoding($text, $out_charset, $in_charset)
- 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 _encoding
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function _encoding(&$text, $in_charset, $out_charset)
{
$xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true);
if($xconv_handler &&
$converted_text = @$xconv_handler->convert_encoding($text, $out_charset, $in_charset)
- 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 gif_outputAsJpeg
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function gif_outputAsJpeg($gif, $lpszFileName, $bgColor = -1)
{
if(gif_outputAsBmp($gif, "$lpszFileName.bmp", $gbColor)) {
exec("cjpeg $lpszFileName.bmp >$lpszFileName 2>/dev/null");
@unLink("$lpszFileName.bmp");
- 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"