Showing 5,566 of 7,504 total issues
Function request
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function request($url, $args = array()) {
$defaults = array(
'method' => 'GET', 'timeout' => 5,
'redirection' => 5, 'httpversion' => '1.0',
'blocking' => true,
- 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 request
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function request($url, $args = array()) {
$defaults = array(
'method' => 'GET', 'timeout' => 5,
'redirection' => 5, 'httpversion' => '1.0',
'blocking' => true,
- 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 wp_get_nav_menu_items
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function wp_get_nav_menu_items( $menu, $args = array() ) {
$menu = wp_get_nav_menu_object( $menu );
if ( ! $menu )
return false;
- 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 url_to_postid
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function url_to_postid($url) {
global $wp_rewrite;
$url = apply_filters('url_to_postid', $url);
- 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 reservationController
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
var reservationController = function ($scope, $http, $q, $location, modalFactory, dataService, moment) {
var url = $location.absUrl();
var lastSlash = url.lastIndexOf('/');
var province = url.slice(lastSlash + 1);
var year = url.slice(lastSlash - 4, lastSlash);
Function registerEventHandlers
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerEventHandlers() {
editor.on('keydown', function(e) {
if (e.isDefaultPrevented()) {
return;
}
Method media_upload_form
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
function media_upload_form( $errors = null ) {
global $type, $tab;
$flash_action_url = admin_url('async-upload.php');
Method column_comment
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
function column_comment( $comment ) {
global $comment_status;
$post = get_post();
$user_can = $this->user_can;
Method read_entry
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
function read_entry($f, $lineno = 0) {
$entry = new Translation_Entry();
// where were we in the last step
// can be: comment, msgctxt, msgid, msgid_plural, msgstr, msgstr_plural
$context = '';
Function extractFiles
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
function extractFiles(evt, callback, allowDir, multiple) {
var files = [], rejFiles = [], items = evt.dataTransfer.items, processing = 0;
function addFile(file) {
if (validate(scope, $parse, attr, file, evt)) {
Function extractFiles
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
function extractFiles(evt, callback, allowDir, multiple) {
var files = [], rejFiles = [], items = evt.dataTransfer.items, processing = 0;
function addFile(file) {
if (validate(scope, $parse, attr, file, evt)) {
Method wp_prepare_revisions_for_js
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null ) {
$post = get_post( $post );
$revisions = $authors = array();
$now_gmt = time();
Method get_body_class
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_body_class( $class = '' ) {
global $wp_query, $wpdb, $current_user;
$classes = array();
Function DataSanitizer
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
var DataSanitizer = (function () {
function DataSanitizer() {
}
DataSanitizer.sanitizeKeyAndAddUniqueness = function (key, map) {
var origLength = key.length;
File jquery.form.dev.js
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* jQuery Form Plugin
* version: 2.02 (12/16/2007)
* @requires jQuery v1.1 or later
*
Function createStates
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
createStates: function() {
var options = this.options;
// Add the default states.
this.states.add([
File module.audio.ac3.php
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
File update-core.php
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Update Core administration panel.
*
* @package WordPress
File nav-menu-template.php
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Navigation Menu template functions
*
* @package WordPress
Function TzDate
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
angular.mock.TzDate = function(offset, timestamp) {
var self = new Date(0);
if (angular.isString(timestamp)) {
var tsStr = timestamp;