Showing 702 of 1,100 total issues
Method uploadPicture
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function uploadPicture($num)
{
require_once $GLOBALS['xoops']->path('class/uploader.php');
$num = (int)$num;
Method PlotPixelsGD
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function PlotPixelsGD(&$BMPdata, $truecolor = true)
{
$imagewidth = $BMPdata['header']['raw']['width'];
$imageheight = $BMPdata['header']['raw']['height'];
Method Colorize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Colorize(&$gdimg, $amount, $targetColor)
{
$amount = (is_numeric($amount) ? $amount : 25);
$amountPct = $amount / 100;
$targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'gray');
Method Sepia
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Sepia(&$gdimg, $amount, $targetColor)
{
$amount = (is_numeric($amount) ? max(0, min(100, $amount)) : 50);
$amountPct = $amount / 100;
$targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'A28065');
Method cloneBlock
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cloneBlock($bid)
{
require_once __DIR__ . '/admin_header.php';
//require_once __DIR__ . '/admin_header.php';
xoops_cp_header();
Method EnsureDirectoryExists
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function EnsureDirectoryExists($dirname, $mask = 0755)
{
// https://www.php.net/manual/en/ini.core.php#ini.open-basedir says:
// "Under Windows, separate the directories with a semicolon. On all other systems, separate the directories with a colon."
$config_open_basedir = ini_get('open_basedir');
Method ApplyMask
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ApplyMask(&$gdimg_mask, &$gdimg_image)
{
if (phpthumb_functions::gd_version() < 2) {
$this->DebugMessage('Skipping ApplyMask() because gd_version is "' . phpthumb_functions::gd_version() . '"', __FILE__, __LINE__);
return false;
Method editBlock
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function editBlock($bid)
{
require_once __DIR__ . '/admin_header.php';
//require_once __DIR__ . '/admin_header.php';
xoops_cp_header();
Function _close
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_close: function() {
_mfpTrigger(CLOSE_EVENT);
var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
Method applyPathSegment
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function applyPathSegment(&$segments, $segment)
{
if ('.' === $segment) {
return; // always remove
}
Method __construct
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($target)
{
// global $helper;
$this->helper = $target->helper;
$this->targetObject = $target;
Method prepareSettings
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareSettings()
{
if (0 == !$this->getValue('field')) {
// field already exists (editing mode)
Method GetCode
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function GetCode(&$data, $bInit)
{
if ($bInit) {
$this->CurBit = 0;
$this->LastBit = 0;
Method applyPathSegment
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function applyPathSegment(&$segments, $segment)
{
if ($segment == '.') {
return; // always remove
}
Function xoops_module_install_pedigree
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_install_pedigree(\XoopsModule $module)
{
$helper = Helper::getInstance();
$moduleDirName = $helper->getDirname();
$configurator = new Configurator();
- 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 mater_side
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function mater_side($p, $m, $a, $ndist)
{
global $fathers, $mothers, $marked, $COIs, $deltaf, $ICknown, $verbose, $nl, $chrono, $paternal_rank, $max_dist;
if (!$m || $ndist > $max_dist) {
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 ImageMagickVersion
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function ImageMagickVersion($returnRAW = false)
{
static $versionstring = null;
if (null === $versionstring) {
$versionstring = [0 => false, 1 => 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 ImageMagickVersion
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function ImageMagickVersion($returnRAW = false)
{
static $versionstring = null;
if (null === $versionstring) {
$versionstring = [0 => false, 1 => 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
Method ResolveSource
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ResolveSource()
{
if (is_resource($this->gdimg_source)) {
$this->DebugMessage('ResolveSource() exiting because is_resource($this->gdimg_source)', __FILE__, __LINE__);
Method SafeExec
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function SafeExec($command)
{
static $AllowedExecFunctions = [];
if (empty($AllowedExecFunctions)) {
$AllowedExecFunctions = ['shell_exec' => true, 'passthru' => true, 'system' => true, 'exec' => true];