Showing 3,141 of 4,341 total issues
File class-wc-countries.php
has 1147 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce countries
*
* @package WooCommerce\l10n
Function prettyPhoto
has 585 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.prettyPhoto = function(pp_settings) {
pp_settings = jQuery.extend({
hook: 'rel', /* the attribute tag to use for prettyPhoto hooks. default: 'rel'. For HTML5, use "data-rel" or similar. */
animation_speed: 'fast', /* fast/slow/normal */
ajaxcallback: function() {},
File class-wc-install.php
has 1141 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Installation related functions and actions.
*
* @package WooCommerce\Classes
File class-wc-api-orders.php
has 1114 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce API Orders Class
*
* Handles requests to the /orders endpoint
File class-wc-rest-products-controller.php
has 1102 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* REST API Products controller
*
* Handles requests to the /products endpoint.
Function output_fields
has a Cognitive Complexity of 136 (exceeds 5 allowed). Consider refactoring. Open
public static function output_fields( $options ) {
foreach ( $options as $value ) {
if ( ! isset( $value['type'] ) ) {
continue;
}
- 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 abstract-wc-order.php
has 1085 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Abstract Order
*
* Handles generic order data and database interaction which is extended by both
File class-wc-helper.php
has 1080 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Admin Helper
*
* @package WooCommerce\Admin\Helper
File class-wc-api-orders.php
has 1076 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce API Orders Class
*
* Handles requests to the /orders endpoint
Function prepare_object_for_database
has a Cognitive Complexity of 132 (exceeds 5 allowed). Consider refactoring. Open
protected function prepare_object_for_database( $request, $creating = false ) {
$id = isset( $request['id'] ) ? absint( $request['id'] ) : 0;
// Type is the most important part here because we need to be using the correct class and methods.
if ( isset( $request['type'] ) ) {
- 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 class-wc-rest-system-status-v2-controller.php
has 994 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* REST API WC System Status controller
*
* Handles requests to the /system_status endpoint.
File class-wc-cart.php
has 988 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce cart
*
* The WooCommerce cart class stores cart data and active coupons as well as handling customer sessions and some cart related urls.
WC_Order
has 126 functions (exceeds 20 allowed). Consider refactoring. Open
class WC_Order extends WC_Abstract_Order {
/**
* Stores data about status changes so relevant hooks can be fired.
*
File jquery.flexslider.js
has 983 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* jQuery FlexSlider v2.7.2
* Copyright 2012 WooThemes
* Contributing Author: Tyler Smith
*/
File wc-product-functions.php
has 982 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Product Functions
*
* Functions for product specific things.
File class-wc-order.php
has 950 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Regular order
*
* @package WooCommerce\Classes
Method get_item_schema
has 469 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_item_schema() {
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'system_status',
'type' => 'object',
Function init
has 467 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init(plot) {
var canvas = null,
target = null,
maxRadius = null,
Function get_order_report_data
has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring. Open
public function get_order_report_data( $args = array() ) {
global $wpdb;
$default_args = array(
'data' => array(),
- 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 html-admin-page-status-report.php
has 921 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Admin View: Page - Status Report.
*
* @package WooCommerce