Showing 44 of 71 total issues
File jquery.infinitescroll.dev.js
has 518 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*global jQuery: true */
/*!
--------------------------------
Infinite Scroll
Function upgrade
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
function upgrade( $from , $to ) {
if ($from < "2.5") {
//array of option conversions in the form of from => to
$map = array(
'js_calls' => 'callback',
- 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
File presets.php
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Infinite Scroll Presets Interface
*
* Stores theme-specific presets for CSS Selectors to aid with setup. Pulls community presets from CSV
Method ivanhoe_create_post_types
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ivanhoe_create_post_types()
{
register_post_type(
'ivanhoe_move',
array(
BasePostForm
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class BasePostForm
{
/**
* The post to edit.
*/
File BasePostForm.php
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This has the default implementation of the POST form for all of the post types.
*/
Infinite_Scroll_Presets
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Infinite_Scroll_Presets {
private $parent;
// public $preset_url = 'http://plugins.svn.wordpress.org/infinite-scroll/branches/PresetDB/presets.csv';
public $preset_url = 'https://raw.github.com/benbalter/Infinite-Scroll/presetDB/presets.csv';
Function infscr_ajax
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
beginAjax: function infscr_ajax(opts) {
var instance = this,
path = opts.path,
box, desturl, method, condition;
Method upgrade
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function upgrade( $from , $to ) {
if ($from < "2.5") {
//array of option conversions in the form of from => to
$map = array(
'js_calls' => 'callback',
Function infscr_create
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function infscr_create(options, callback) {
// Add custom options to defaults
var opts = $.extend(true, {}, $.infinitescroll.defaults, options);
this.options = opts;
Function ivanhoe_page_menu
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function ivanhoe_page_menu( $args = array() )
{
$defaults = array(
'sort_column' => 'menu_order, post_title',
- 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
Method ivanhoe_page_menu
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ivanhoe_page_menu( $args = array() )
{
$defaults = array(
'sort_column' => 'menu_order, post_title',
Function infscr_loadcallback
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadcallback: function infscr_loadcallback(box, data, url) {
var opts = this.options,
callback = this.options.callback, // GLOBAL OBJECT FOR CALLBACK
result = (opts.state.isDone) ? 'done' : (!opts.appendCallback) ? 'no-append' : 'append',
frag;
Function ivanhoe_move_source_save_meta_box_data
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function ivanhoe_move_source_save_meta_box_data($post_id=null)
{
$post_id = (is_null($post_id)) ? get_post()->ID : $post_id;
/*
- 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
Method prepare_items
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepare_items() {
global $infinite_scroll;
$per_page = 25;
Function ivanhoe_role_id_save_meta_box_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function ivanhoe_role_id_save_meta_box_data($post_id=null)
{
$post_id = (is_null($post_id)) ? get_post()->ID : $post_id;
/*
- 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
Method ivanhoe_nav_menu_items
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ivanhoe_nav_menu_items()
{
global $wp;
$items = '';
Function infscr_init
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.infinitescroll = function infscr_init(options, callback) {
var thisCall = typeof options;
Method get_move_source_message
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_move_source_message($game)
{
$buffer = '';
Function get_name
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function get_name( $stylesheet ) {
//3.4+
if ( function_exists( 'wp_get_theme' ) ) {
- 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"