Showing 552 of 784 total issues
CrawlerUrl
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class CrawlerUrl
{
/**
* Stores the base url of current crawling session
*
CrawlerUrlTest
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class CrawlerUrlTest extends TestCase
{
/**
* Setup the test environment.
*
Function runTool
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
runTool: function(D, A, r) {
var G, w, C, v, y, q, B, t, F, E, x, z = YSLOW.Tools.getTool(D);
try {
if (typeof z === "object") {
G = z.run(A.document, A.component_set, r);
Function handle
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
public function handle(ProjectWatcher $event)
{
$urlsFromDatabase = $event->project->urls->pluck('url');
if (is_string($urlsFromDatabase)) {
$urlsFromDatabase = (array)$urlsFromDatabase;
- 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 ajaxConvert
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ajaxConvert( s, response, jqXHR, isSuccess ) {
var conv2, current, conv, tmp, prev,
converters = {},
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice();
Function ajaxConvert
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ajaxConvert( s, response, jqXHR, isSuccess ) {
var conv2, current, conv, tmp, prev,
converters = {},
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice();
Function getDict
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getDict: function(t, B) {
var x, z, s, w, q, A, v, r = YSLOW,
y = r.controller,
C = r.doc.rules,
u = {
File ResultReader.php
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Suitcoda\Supports;
use Suitcoda\Model\Issue;
Function lint
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lint: function(B, E, s) {
var u, y, t, v, A, x, D, C = (E.inline && E.inline.styles) || [],
r = E.getComponentsByType("css"),
w = [],
q = 0,
Function init
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var init = function () {
function drawGraph ( graph, dataTitle, dataSeries, dataXAxis) {
var option = {
title: {
Function init
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var init = function () {
function drawGraph ( graph, dataTitle, dataSeries, dataXAxis) {
var option = {
title: {
Function _setAvgMilestone
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setAvgMilestone: function(par) {
if (par) {
var that = par.that;
var $el = par.$el;
var opt = that.opt;
Function setSplashView
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setSplashView: function(r, s, t) {
var w, v = "Grade your web pages with YSlow",
x = "YSlow gives you:",
u = "<li>Grade based on the performance (you can define your own rules)</li><li>Summary of the Components in the page</li><li>Chart with statistics</li><li>Tools including Smush.It and JSLint</li>",
q = "Learn more about YSlow and YDN";
Function saveRuleset
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
saveRuleset: function(y, r) {
var t, s, v, q, u, z, B, A, x = {},
w = {};
if (r) {
x.custom = true;
Function remove
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, handleObj, tmp,
origCount, t, events,
special, handlers, type,
namespaces, origType,
Function remove
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, handleObj, tmp,
origCount, t, events,
special, handlers, type,
namespaces, origType,
Method doRequest
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function doRequest($url, $try = null)
{
if (is_null($try)) {
$try = $this->retry;
}
Consider simplifying this complex logical expression. Open
Open
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );
Function onTouchEnd
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FastClick.prototype.onTouchEnd = function(event) {
'use strict';
var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
if (!this.trackingClick) {
Consider simplifying this complex logical expression. Open
Open
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );