Showing 1,049 of 26,336 total issues
Method Sepia
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function Sepia(&$gdimg, $amount, $targetColor)
{
$amount = (is_numeric($amount) ? max(0, min(100, $amount)) : 50);
$amountPct = $amount / 100;
$targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'A28065');
Method Colorize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function Colorize(&$gdimg, $amount, $targetColor)
{
$amount = (is_numeric($amount) ? $amount : 25);
$amountPct = $amount / 100;
$targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'gray');
Function fade
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fade: function (up, to) {
this.outlineWhileAnimating = false;
var exp = this, t = up ? hs.expandDuration : 0;
if (up) {
Function getInline
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 fade
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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 showHideElements
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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
Open
&$gdimg,
$text,
$size,
$alignment,
$hex_color = '000000',
Function dim
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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 getInline
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 dim
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
dim: function (exp) {
if (!hs.dimmer) {
isNew = true;
hs.dimmer = hs.createElement('div', {
className: 'highslide-dimming highslide-viewport-size',
Function loadHTML
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 loadHTML
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 ResolveSource
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function ResolveSource()
{
if (is_resource($this->gdimg_source)) {
$this->DebugMessage('ResolveSource() exiting because is_resource($this->gdimg_source)', __FILE__, __LINE__);
Method GetCode
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function GetCode(&$data, $bInit)
{
if ($bInit) {
$this->CurBit = 0;
$this->LastBit = 0;
Method applyPathSegment
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function applyPathSegment(&$segments, $segment)
{
if ($segment == '.') {
return; // always remove
}
Function getPageSize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
getPageSize: function () {
var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat'
? d.documentElement : d.body,
ieLt9 = hs.ie && (hs.uaVersion < 9 || typeof pageXOffset == 'undefined');
- 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"