Showing 47,251 of 47,256 total issues
Method editblock
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function editblock($bid = 0, $clone = FALSE) {
global $icms_block_handler, $icmsAdminTpl;
$blockObj = $icms_block_handler->get($bid);
Identical blocks of code found in 2 locations. Consider refactoring. Open
function getUniqueElementID(element) {
if (element === window) return 0;
if (typeof element._prototypeUID === 'undefined')
element._prototypeUID = Element.Storage.UID++;
- 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 62.
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
function getUniqueElementID(element) {
if (element === window) return 0;
if (typeof element._prototypeUID === 'undefined')
element._prototypeUID = Element.Storage.UID++;
- 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 62.
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
Consider simplifying this complex logical expression. Open
} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
diff = cache[1];
} else {
while ( (node = ++nodeIndex && node && node[ dir ] ||
Consider simplifying this complex logical expression. Open
if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
submit !== false && (!submit || key == submit) && (submitted = true)))) {
result = accumulator(result, key, value);
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (isset($request['ROOT_PATH'])) {
$request['ROOT_PATH'] = str_replace( "\\", "/", $request['ROOT_PATH'] );
if (substr( $request['ROOT_PATH'], -1 ) == '/') {
$request['ROOT_PATH'] = substr( $request['ROOT_PATH'], 0, -1 );
}
- 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 107.
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 (isset($request['TRUST_PATH'])) {
$request['TRUST_PATH'] = str_replace( "\\", "/", $request['TRUST_PATH'] );
if (substr( $request['TRUST_PATH'], -1 ) == '/') {
$request['TRUST_PATH'] = substr( $request['TRUST_PATH'], 0, -1 );
}
- 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 107.
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 xoopsValidate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoopsValidate(subjectId, textareaId, submitId, plzCompletePhrase, msgTooLongPhrase, allowedCharPhrase, currCharPhrase) {
var maxchars = 65535;
var subjectDom = xoopsGetElementById(subjectId);
var textareaDom = xoopsGetElementById(textareaId);
var submitDom = xoopsGetElementById(submitId);
Function keynav
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.keynav = function (onClass,offClass) {
//Initialization
var kn = $.keynav;
if(!kn.init) {
kn.el = new Array();
Method icms_html2text
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function icms_html2text($document)
{
// PHP Manual:: function preg_replace
// $document should contain an HTML document.
// This will remove HTML tags, javascript sections
Method icms_getModuleConfig
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function &icms_getModuleConfig($moduleName = false)
{
static $icmsConfigs;
if(isset ($icmsConfigs[$moduleName]))
{
Method b_system_notification_show
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_system_notification_show() {
icms_loadLanguageFile('core', 'notification');
// Notification must be enabled, and user must be logged in
if (empty(icms::$user) || !icms_data_notification_Handler::isEnabled('block')) {
return false; // do not display block
Function xoopsCodeImg
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoopsCodeImg(id, enterImgUrlPhrase, enterImgPosPhrase, imgPosRorLPhrase, errorImgPosPhrase){
if (enterImgUrlPhrase == null) {
enterImgUrlPhrase = "Enter the URL of the image you want to add:";
}
var text = prompt(enterImgUrlPhrase, "");
Function addItem
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addItem(itemurl, name, target, cat, url, type) {
var win = opener;
var campo = win.document.getElementById(target);
var opcoes = win.document.getElementById('img_cat_'+cat);
var imagem = win.document.getElementById(target+'_img');
Method jalali_to_gregorian
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
Method intval_allrequestsendid
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function intval_allrequestsendid() {
if ($this->_done_intval)
return true;
else
$this->_done_intval = true;
Method execute
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function execute($type) {
$ret = 0;
$filters = array ();
Method editcustomtag
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function editcustomtag($customtagid = 0, $clone = FALSE) {
global $icms_customtag_handler, $icmsAdminTpl, $customtagid;
icms_cp_header();
$customtagObj = $icms_customtag_handler->get($customtagid);
Method synchronize
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function synchronize($id, $type) {
switch($type) {
case 'user':
// Array of tables from which to count 'posts'
$tables = array();
Identical blocks of code found in 10 locations. Consider refactoring. Open
if (is_array($groups) && !empty($groups)) {
$criteriaTray = new icms_db_criteria_Compo();
foreach ($groups as $gid) {
$criteriaTray->add(new icms_db_criteria_Item('gperm_groupid', $gid), 'OR');
}
- 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 106.
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