Showing 355 of 3,032 total issues
Method getLocalImagePath
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getLocalImagePath($src)
{
$src = ltrim($src, '/'); //strip off the leading '/'
if (!$this->docRoot) {
$this->debug(3, 'We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.');
Method resizeAndCrop
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resizeAndCrop()
{
// check file extension
switch ($this->imageMimetype) {
case 'image/png':
Method assign
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function assign(\XoopsTpl $tpl): void
{
$i = -1;
$tab = -1;
$elements = [];
Function publisher_items_random_item_show
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function publisher_items_random_item_show($options)
{
$block = [];
$helper = Helper::getInstance();
- 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 getKey
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function getKey(string $line): array
{
$key = [];
if (\strpos($line, 'RIMARY') > 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 assign
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function assign(\XoopsTpl $tpl): void
{
$i = -1;
$tab = -1;
$elements = [];
- 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 publisher_items_new_edit
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function publisher_items_new_edit($options)
{
// require_once PUBLISHER_ROOT_PATH . '/class/blockform.php';
xoops_load('XoopsFormLoader');
Method getTitle
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getTitle($title = '', $withExt = true)
{
/**
* if XOOPS ML is present, let's sanitize the title with the current language
*/
Method orderBlock
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
array $bid,
array $oldtitle,
array $oldside,
array $oldweight,
array $oldvisible,
Method loadSampleData
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadSampleData(): void
{
global $xoopsConfig;
$moduleDirName = \basename(\dirname(__DIR__));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Method serveWebshot
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function serveWebshot()
{
$this->debug(3, 'Starting serveWebshot');
$instr = 'Please follow the instructions at https://code.google.com/p/timthumb/ to set your server up for taking website screenshots.';
if (!is_file(WEBSHOT_CUTYCAPT)) {
Method getAllFiles
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllFiles($itemId = 0, $status = -1, $limit = 0, $start = 0, $sort = 'datesub', $order = 'DESC', $category = [])
{
$files = [];
$this->table_link = $this->db->prefix($this->helper->getDirname() . '_items');
Method getFormFeedback
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFormFeedback($action = false)
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
Function AjaxUpload
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.AjaxUpload = function (button, options) {
this._settings = {
// Location of the server-side upload script
action: 'upload.php',
// File upload name
Method getObjects
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function &getObjects(\CriteriaElement $criteria = null, $idKey = 'none', $as_object = true, $notNullFields = null)
{
$limit = $start = 0;
$ret = [];
$notNullFields = (null !== $notNullFields) ?: '';
Function mergeImage
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function mergeImage(): void
{
$dest = \imagecreatefromjpeg($this->endFile);
$src = \imagecreatefromjpeg($this->sourceFile);
if (4 == $this->mergeType) {
- 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 closeTags
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function closeTags($string)
{
// match opened tags
if (\preg_match_all('/<([a-z\:\-]+)[^\/]>/', $string, $startTags)) {
$startTags = $startTags[1];
- 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 renderErrors
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function renderErrors($errArray, $reseturl = ''): void
{
if ($errArray && \is_array($errArray)) {
echo '<div id="readOnly" class="errorMsg" style="border:1px solid #D24D00; background:#FEFECC url(' . PUBLISHER_URL . '/assets/images/important-32.png) no-repeat 7px 50%;color:#333;padding-left:45px;">';
- 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 getImages
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getImages()
{
static $ret;
$itemId = (int)$this->getVar('itemid');
if (!isset($ret[$itemId])) {
- 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 checkVerModule
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
{
/*
// Generated by curl-to-PHP: https://incarnate.github.io/curl-to-php/
$ch = curl_init();