Showing 20 of 33 total issues
File jquery.iviewer.js
has 700 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* iviewer Widget for jQuery UI
* https://github.com/can3p/iviewer
*
* Copyright (c) 2009 - 2012 Dmitry Petrov
File jquery.dotdotdot-1.5.9.js
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* jQuery dotdotdot 1.5.9
*
* Copyright (c) 2013 Fred Heusschen
* www.frebsite.nl
Function dotdotdot
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.dotdotdot = function( o )
{
if ( this.length == 0 )
{
if ( !o || o.debug !== false )
Function bind_events
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$dot.bind_events = function()
{
$dot.bind(
'update.dot',
function( e, c )
Function _create
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_create: function() {
var me = this;
//drag variables
this.dx = 0;
Function ellipsisElement
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ellipsisElement( $e, $d, $i, o, after )
{
var isTruncated = false,
e = $e[ 0 ];
Function handler
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function handler(event) {
var orgEvent = event || window.event,
args = slice.call(arguments, 1),
delta = 0,
deltaX = 0,
Request
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Request
{
/**
* @var string $requestUri Request URI from $_SERVER.
* @var string $scriptName Scriptname from $_SERVER, actual scriptname part.
Function setImageProps
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.setImageProps = function(disp_w, disp_h, x, y, skip_animation, complete) {
complete = complete || jQuery.noop;
this.display_width(disp_w);
this.display_height(disp_h);
Function set_zoom
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
set_zoom: function(new_zoom, skip_animation, zoom_center)
{
if (this._trigger('onZoom', 0, new_zoom) == false) {
return;
}
Function watch
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$dot.watch = function()
{
$dot.unwatch();
if ( opts.watch == 'window' )
{
Function ellipsis
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ellipsis( $elem, $d, $i, o, after )
{
var $elements = $elem.contents(),
isTruncated = false;
Function children
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function children( $elem, o, after )
{
var $elements = $elem.children(),
isTruncated = false;
Function onload
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.onload = function() {
function addIcon(el, entity) {
var html = el.innerHTML;
el.innerHTML = '<span style="font-family: \'phpdocumentor-clean-icons\'">' + entity + '</span>' + html;
}
Method extractRoute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function extractRoute()
{
$requestUri = $this->requestUri;
$scriptPath = $this->path;
$scriptFile = $this->scriptName;
Function onload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
window.onload = function() {
function addIcon(el, entity) {
var html = el.innerHTML;
el.innerHTML = '<span style="font-family: \'phpdocumentor-clean-icons\'">' + entity + '</span>' + html;
}
- 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 setImageProps
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
this.setImageProps = function(disp_w, disp_h, x, y, skip_animation, complete) {
Function ellipsis
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function ellipsis( $elem, $d, $i, o, after )
Function ellipsisElement
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function ellipsisElement( $e, $d, $i, o, after )
Avoid too many return
statements within this function. Open
Open
return false;