Showing 47,251 of 47,256 total issues
Method icms_getModuleHandler
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function &icms_getModuleHandler($name = null, $module_dir = null, $module_basename = null, $optional = false) {
static $handlers;
// if $module_dir is not specified
if (!isset($module_dir)) {
//if a module is loaded
Method exec
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exec() {
if (!$this->getVar('sat_enabled')) return FALSE;
if (((int) $this->getVar('sat_lastruntime') + (int) $this->getVar('sat_interval') * 60) > time()) return FALSE;
$code = $this->getVar('sat_code');
ignore_user_abort(TRUE);
Method displayGroups
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayGroups() {
icms_cp_header();
echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_MODULES_URL . '/system/admin/groups/images/groups_big.png)">' . _AM_EDITADG . '</div><br />';
$member_handler = icms::handler('icms_member');
$groups = $member_handler->getGroups();
Method AllowedModules
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function AllowedModules($mimetype, $module) {
$mimetypeid_allowed = $dirname_allowed = FALSE;
$GrantedItems = $this->UserCanUpload();
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('types', '%' . $mimetype . '%', 'LIKE'));
Method b_system_admin_cp_show
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_system_admin_cp_show() {
global $icmsTpl, $icmsConfig;
$block['lang_cp'] = _CPHOME;
$block['lang_insmodules'] = _AD_INSTALLEDMODULES;
Method b_system_newmembers_show
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_system_newmembers_show($options) {
global $icmsConfigUser;
$block = array();
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('level', 0, '>'));
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (is_array($deltpl)) {
$xoopsDelTpl = new icms_view_Tpl();
// clear cache files
$xoopsDelTpl->clear_cache(null, 'mod_'.$dirname);
// delete template file entry in db
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 110.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (is_array($deltpl)) {
$xoopsDelTpl = new icms_view_Tpl();
// clear cache files
$xoopsDelTpl->clear_cache(NULL, 'mod_' . $dirname);
// delete template file entry in db
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 110.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function serializeElements
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
serializeElements: function(elements, options) {
if (typeof options != 'object') options = { hash: !!options };
else if (Object.isUndefined(options.hash)) options.hash = true;
var key, value, submitted = false, submit = options.submit, accumulator, initial;
Function update
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update(element, content) {
element = $(element);
var descendants = element.getElementsByTagName('*'),
i = descendants.length;
Method imcms_get_base_domain
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function imcms_get_base_domain($url)
{
$debug = 0;
$base_domain = '';
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($confcount > 0) {
array_push($block['msg'], icms_core_Message::error(_TinyMCE_DEFAULT_WARNING), '', false);
} else {
if (in_array('tinymce', array_flip($editorhandler->getList()))) {
array_push($block['msg'], icms_core_Message::error(_TinyMCE_PRESENT_WARNING), '', false);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 109.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($confcount > 0) {
array_push($block['msg'], icms_core_Message::error(_FCK_DEFAULT_WARNING), '', false);
} else {
if (in_array('FCKeditor', array_flip($editorhandler->getList()))) {
array_push($block['msg'], icms_core_Message::error(_FCK_PRESENT_WARNING), '', false);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 109.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function selFilter
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function selFilter(id,value){
var div_arg1 = xoopsGetElementById(id+'_arg1');
var div_arg2 = xoopsGetElementById(id+'_arg2');
var div_arg3 = xoopsGetElementById(id+'_arg3');
- 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 navigate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function navigate(direction) {
// Check if any of the menu items is selected
if(jQuery("#suggestions ul li .itemhover").size() == 0) {
currentSelection = -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 xoopsSmilies
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function xoopsSmilies($textarea_id)
{
icms_core_Debug::setDeprecated('icms_form_elements_Dhtmltextarea.', sprintf(_CORE_REMOVE_IN_VERSION, '2.0'));
$smiles =& icms_core_DataFilter::getSmileys();
if (empty($smileys)) {
- 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 getDirList
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function getDirList($dirname) {
$dirlist = array();
if (is_dir($dirname) && $handle = opendir($dirname)) {
while (false !== ($file = readdir($handle))) {
if (substr( $file, 0, 1 ) != '.' && strtolower($file) != 'cvs') {
- 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 xoops_getcss
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function xoops_getcss($theme = '')
{
if($theme == '') {$theme = $GLOBALS['icmsConfig']['theme_set'];}
$uagent = xoops_getenv('HTTP_USER_AGENT');
if(stristr($uagent, 'mac')) {$str_css = 'styleMAC.css';}
- 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 getSystemHandlersList
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getSystemHandlersList($checkIfItIsAvaibleOnCurrentSystem = TRUE) {
static $ret = NULL;
if ($ret === NULL) {
$files = glob($this->getSystemHandlerFileName('*'));
$ret = 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 report
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function report() {
$commands = array( 'create', 'insert', 'alter', 'drop' );
$content = '<ul class="log">';
foreach ( $commands as $cmd) {
if (!@empty( $this->s_tables[$cmd] )) {
- 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"