Showing 702 of 1,100 total issues
Method ImageCopyResampleBicubic
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function ImageCopyResampleBicubic($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
{
// ron at korving dot demon dot nl
// http://www.php.net/imagecopyresampled
Consider simplifying this complex logical expression. Open
if ((is_resource($gdimg_dest) || (is_object($gdimg_dest) && $gdimg_dest instanceof \GdImage)) && (is_resource($img_watermark) || (is_object($img_watermark) && $img_watermark instanceof \GdImage))) {
$img_source_width = imagesx($gdimg_dest);
$img_source_height = imagesy($gdimg_dest);
$watermark_source_width = imagesx($img_watermark);
$watermark_source_height = imagesy($img_watermark);
Method pedigree_fields_form
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pedigree_fields_form()
{
$config_fields = pedigree_get_config_fields();
$values = pedigree_get_config();
print "
Method lettersChoice
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function lettersChoice()
{
$helper = Helper::getInstance();
$helper->loadLanguage('main');
xoops_load('XoopsLocal');
Method load
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load($data, &$datLen)
{
$datLen = 0;
while (true) {
Method ResolveSource
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ResolveSource()
{
if (is_resource($this->gdimg_source) || (is_object($this->gdimg_source) && $this->gdimg_source instanceof \GdImage)) {
$this->DebugMessage('ResolveSource() exiting because is_resource($this->gdimg_source)', __FILE__, __LINE__);
return true;
Method CleanUpURLencoding
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function CleanUpURLencoding($url, $queryseperator = '&')
{
if (!0 === stripos($url, "http")) {
return $url;
}
Method SKETCH_PEDIGREE
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SKETCH_PEDIGREE()
{
global $nl, $detail, $depth, $IDs;
// print_r ($IDs) ;
echo $nl
Function _parseMarkup
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
_parseMarkup: function(template, values, item) {
var arr;
if(item.data) {
values = $.extend(item.data, values);
}
Method updateBlock
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
{
$myblock = new \XoopsBlock($bid);
$myblock->setVar('title', $btitle);
$myblock->setVar('weight', $bweight);
Method loadTableFromArrayWithReplace
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadTableFromArrayWithReplace($table, $data, $search, $replace)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
Method calc_dist
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function calc_dist() /* Common Ascendants and their distances */
{
global $IDs, $fathers, $mothers, $nbanims, $pater, $mater, $empty, $nb_gen, $nl;
global $dmax, $detail, $nb_gen;
$distan = [];
Method lettersChoice
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function lettersChoice($myObject, $activeObject, $criteria, $name, $link, $link2 = null)
{
/** @var \XoopsModules\Pedigree\Helper $helper */
$helper = Helper::getInstance();
$helper->loadLanguage('main');
Method getFileStatus
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getFileStatus($file_path, $original_file_path = null, $redirectFile = null)
{
global $pathIcon16;
if (empty($file_path)) {
Method GD2BMPstring
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function GD2BMPstring(&$gd_image)
{
$imageX = imagesx($gd_image);
$imageY = imagesy($gd_image);
Method skipExt
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function skipExt(&$data, &$extLen)
{
$extLen = 0;
$b = ord($data[0]);
Method WhiteBalance
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function WhiteBalance(&$gdimg, $targetColor = '')
{
if (phpthumb_functions::IsHexColor($targetColor)) {
$targetPixel = [
'red' => hexdec(substr($targetColor, 0, 2)),
Function output_animal
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function output_animal($ind, $gen, $class)
{
global $depth, $IDs, $fathers, $mothers, $nl;
if ($gen > $depth) {
return 0;
- 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
bind: function () {
var matchClass = new RegExp('(^|\\s)(' + jscolor.bindClass + ')(\\s*(\\{[^}]*\\})|\\s|$)', 'i');
var e = document.getElementsByTagName('input');
for (var i = 0; i < e.length; i += 1) {
var m;
- 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 FixedAspectRatio
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function FixedAspectRatio()
{
// optional fixed-dimension images (regardless of aspect ratio)
if (!$this->far) {
- 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"