Showing 26,336 of 26,336 total issues
Function fade
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
fade: function (up, to) {
this.outlineWhileAnimating = false;
var exp = this, t = up ? hs.expandDuration : 0;
if (up) {
Function showHideElements
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
showHideElements: function (tagName, visibility) {
var els = document.getElementsByTagName(tagName);
var prop = tagName == '*' ? 'overflow' : 'visibility';
for (var i = 0; i < els.length; i++) {
if (prop == 'visibility' || (document.defaultView.getComputedStyle(
Function getInline
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
getInline: function (types, addOverlay) {
for (var i = 0; i < types.length; i++) {
var type = types[i], s = null;
if (type == 'caption' && !hs.fireEvent(this, 'onBeforeGetCaption')) return;
else if (type == 'heading' && !hs.fireEvent(this, 'onBeforeGetHeading')) return;
Function showHideElements
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
showHideElements: function (tagName, visibility) {
var els = document.getElementsByTagName(tagName);
var prop = tagName == '*' ? 'overflow' : 'visibility';
for (var i = 0; i < els.length; i++) {
if (prop == 'visibility' || (document.defaultView.getComputedStyle(
Method save
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function save($filename, $maxWidth, $maxHeight)
{
$thumbPath = XOOPS_UPLOAD_PATH . '/apcal/thumbs/' . $filename;
$imgPath = XOOPS_UPLOAD_PATH . '/apcal/' . $filename;
$nSize = self::make($filename, $maxWidth, $maxHeight);
Method get_time_desc_for_a_day
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_time_desc_for_a_day(
$event,
$tzoffset,
$border_for_2400,
$justify = true,
Method WatermarkText
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
&$gdimg,
$text,
$size,
$alignment,
$hex_color = '000000',
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!hs.allowMultipleInstances && hs.focusKey != this.key) {
try {
hs.expanders[hs.focusKey].close();
} catch (e) {
}
- 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 65.
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 (!hs.allowMultipleInstances && hs.focusKey != this.key) {
try {
hs.expanders[hs.focusKey].close();
} catch (e) {
}
- 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 65.
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
The class APCal has 127 fields. Consider redesigning APCal to keep the number of fields under 15. Open
class APCal
{
// SKELTON (they will be defined in language files)
public $holidays = array();
public $date_short_names = array();
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
The class phpthumb has 140 fields. Consider redesigning phpthumb to keep the number of fields under 15. Open
class phpthumb
{
// public:
// START PARAMETERS (for object mode and phpThumb.php)
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
The class CGIFLZW has 19 fields. Consider redesigning CGIFLZW to keep the number of fields under 15. Open
class CGIFLZW
{
public $MAX_LZW_BITS;
public $Fresh;
public $CodeSize;
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
Function dim
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
dim: function (exp) {
if (!hs.dimmer) {
isNew = true;
hs.dimmer = hs.createElement('div', {
className: 'highslide-dimming highslide-viewport-size',
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__);
Function loadHTML
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadHTML: function () {
var s = this.cachedGet || this.xhr.responseText,
regBody;
if (this.pre) hs.cachedGets[this.src] = s;
if (!hs.ie || hs.uaVersion >= 5.5) {
Function dim
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
dim: function (exp) {
if (!hs.dimmer) {
isNew = true;
hs.dimmer = hs.createElement('div', {
className: 'highslide-dimming highslide-viewport-size',
Function getInline
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
getInline: function (types, addOverlay) {
for (var i = 0; i < types.length; i++) {
var type = types[i], s = null;
if (!this[type + 'Id'] && this.thumbsUserSetId)
this[type + 'Id'] = type + '-for-' + this.thumbsUserSetId;
Function loadHTML
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadHTML: function () {
var s = this.cachedGet || this.xhr.responseText,
regBody;
if (this.pre) hs.cachedGets[this.src] = s;
if (!hs.ie || hs.uaVersion >= 5.5) {
Method applyPathSegment
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function applyPathSegment(&$segments, $segment)
{
if ($segment == '.') {
return; // always remove
}
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;