Showing 26,336 of 26,336 total issues
Function close
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
close: function () {
if (this.isClosing || !this.isExpanded) return;
if (this.transitions[1] == 'crossfade' && hs.upcoming) {
hs.getExpander(hs.upcoming).cancelLoading();
hs.upcoming = null;
Function writeExtendedContent
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
writeExtendedContent: function () {
if (this.hasExtendedContent) return;
var exp = this;
this.body = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body');
if (this.objectType == 'iframe') {
Method _compareseq
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _compareseq($xoff, $xlim, $yoff, $ylim)
{
/* Slide down the bottom initial diagonal. */
while ($xoff < $xlim && $yoff < $ylim && $this->xv[$xoff] == $this->yv[$yoff]) {
++$xoff;
Method import_ics_via_fopen
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function import_ics_via_fopen($uri, $force_http = true, $user_uri = '')
{
if (strlen($uri) < 5) {
return '-1:';
}
Method import_ics_via_fopen
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function import_ics_via_fopen($uri, $force_http = true, $user_uri = '')
{
$user_uri = empty($user_uri) ? '' : $uri;
// changing webcal://* to http://*
$uri = str_replace('webcal://', 'http://', $uri);
Method apcal_new_event_edit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function apcal_new_event_edit($options)
{
global $xoopsDB, $xoopsConfig;
$moduleDirName = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0];
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (Calendar.is_ie) {
posY = window.event.clientY + document.body.scrollTop;
posX = window.event.clientX + document.body.scrollLeft;
} else {
posX = ev.pageX;
- 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 58.
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 (Calendar.is_ie) {
posY = window.event.clientY + document.body.scrollTop;
posX = window.event.clientX + document.body.scrollLeft;
} else {
posY = ev.clientY + window.scrollY;
- 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 58.
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
Method HistogramOverlay
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
&$gdimg,
$bands = '*',
$colors = '',
$width = 0.25,
$height = 0.25,
Method ImageCopyRespectAlpha
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
&$dst_im,
&$src_im,
$dst_x,
$dst_y,
$src_x,
Function dayMouseDown
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Calendar.dayMouseDown = function (ev) {
var el = Calendar.getElement(ev);
if (el.disabled) {
return false;
}
Function setSize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
setSize: function (i) {
var exp = this.exp;
if (exp.isImage && (exp.useBox || hs.padToMinWidth)) {
this.imgSize = i;
this.size = Math.max(this.size, this.imgSize);
Function initSlideshow
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
initSlideshow: function () {
if (!this.last) {
for (var i = 0; i < hs.slideshows.length; i++) {
var ss = hs.slideshows[i], sg = ss.slideshowGroup;
if (typeof sg == 'undefined' || sg === null || sg === this.slideshowGroup)
Function initSlideshow
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
initSlideshow: function () {
if (!this.last) {
for (var i = 0; i < hs.slideshows.length; i++) {
var ss = hs.slideshows[i], sg = ss.slideshowGroup;
if (typeof sg == 'undefined' || sg === null || sg === this.slideshowGroup)
Method getParsedTemplate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getParsedTemplate($name = '')
{
$name = strtoupper($name);
// if a name was given, parse only this template
Method delete_schedule
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function delete_schedule($whr_sql_append = '', $eval_after = null)
{
if (!empty($_POST['event_id'])) {
$event_id = (int)$_POST['event_id'];
Method b_sitemap_APCal_base
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_sitemap_APCal_base($moduleDirName)
{
global $xoopsConfig, $xoopsDB, $xoopsUser;
$myts = MyTextSanitizer::getInstance();
Method ImageMagickSwitchAvailable
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ImageMagickSwitchAvailable($switchname)
{
static $IMoptions = null;
if (is_null($IMoptions)) {
$IMoptions = array();
Method FixedAspectRatio
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function FixedAspectRatio()
{
// optional fixed-dimension images (regardless of aspect ratio)
if (!$this->far) {
Method RenderToFile
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function RenderToFile($filename)
{
if (preg_match('#^[a-z0-9]+://#i', $filename)) {
$this->DebugMessage('RenderToFile() failed because $filename (' . $filename . ') is a URL', __FILE__, __LINE__);