Showing 1,099 of 1,425 total issues
Method register_post_types
has 615 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function register_post_types() {
$permalinks = llms_get_permalink_structure();
// Course.
$catalog_id = llms_get_page_id( 'shop' );
File class.llms.post-types.php
has 1102 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Register Post Types, Taxonomies, Statuses.
*
* @package LifterLMS/Classes
Function Metaboxes
has 507 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Metaboxes = function() {
/**
* load all partials
*/
File model.llms.order.php
has 917 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* LLMS_Order class/model file
*
* @package LifterLMS/Models/Classes
Method output_field
has 417 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function output_field( $field ) {
// Set missing values with defaults.
$field = self::set_field_defaults( $field );
File model.llms.student.php
has 854 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Student Model
*
* @package LifterLMS/Models/Classes
Function metabox_product
has 409 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.llms.metabox_product = function() {
/**
* jQuery obj for the main $( '#llms-access-plans' ) element.
*
File class.llms.ajax.handler.php
has 803 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* LifterLMS AJAX Event Handler.
*
* @package LifterLMS/Classes
Method get_fields
has 354 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_fields() {
global $post;
$course = new LLMS_Course( $this->post );
File class.llms.admin.builder.php
has 683 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* LifterLMS Admin Course Builder
*
* @package LifterLMS/Admin/Classes
Method get_settings
has 303 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_settings() {
$account_settings = array(
array(
'class' => 'top',
'id' => 'course_account_options',
File class.llms.admin.settings.php
has 668 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Admin Settings and fields
*
* @package LifterLMS/Admin/Classes
File abstract.llms.post.model.php
has 660 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* LLMS_Post_Model abstract class file
*
* @package LifterLMS/Abstracts/Classes
Function Analytics
has 287 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Analytics = function( opts ) {
if ( ! $( '#llms-analytics-json' ).length ) {
return;
}
Function output_field
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
public static function output_field( $field ) {
// Set missing values with defaults.
$field = self::set_field_defaults( $field );
- 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 llms_checkout
has 262 lines of code (exceeds 25 allowed). Consider refactoring. Open
var llms_checkout = function() {
/**
* Array of validation functions to call on form submission
*
Function llms_update_3160_attempt_migration
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
function llms_update_3160_attempt_migration() {
global $wpdb;
$query = $wpdb->get_results( "SELECT user_id, meta_value FROM {$wpdb->usermeta} WHERE meta_key = 'llms_quiz_data' LIMIT 100;" ); // db call ok; no-cache ok.
- 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 llms.functions.templates.dashboard.php
has 584 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Template functions for the student dashboard
*
* @package LifterLMS/Functions
File llms.template.functions.php
has 550 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Front end template functions
*
* @package LifterLMS/Functions/Templates
Function llms_update_3160_update_question_data
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
function llms_update_3160_update_question_data() {
if ( 'complete' !== get_transient( 'llms_update_3160_ensure_no_lesson_dupe_rels' ) ) {
return 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"