Showing 1,420 of 1,425 total issues
Method is_instructor
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function is_instructor( $post_id = null ) {
$ret = false;
// Use current post if no post is set.
Method instructors_mb_store
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function instructors_mb_store( $request ) {
// validate required params.
if ( ! isset( $request['store_action'] ) || ! isset( $request['post_id'] ) ) {
Method lost_password
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function lost_password() {
// Invalid nonce or the form wasn't submitted.
if ( ! llms_verify_nonce( '_lost_password_nonce', 'llms_lost_password', 'POST' ) ) {
return null;
Method _migrate_awards
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _migrate_awards( $type ) {
$per_page = llms_update_util_get_items_per_page();
$query_args = array(
Method maybe_clean_earned_engagments_related_user_post_meta
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function maybe_clean_earned_engagments_related_user_post_meta( $post_id ) {
$post_types = array(
'llms_my_certificate',
'llms_my_achievement',
Function bind
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
bind: function() {
$( '#llms_review_submit_button' ).click(function()
{
if ($( '#review_title' ).val() !== '' && $( '#review_text' ).val() !== '') {
jQuery.ajax({
- 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 action
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
action: ( { increment, preid, exclude, force, skipConfig, replacements, extraReplacements } ) => {
const version = force ? force : getNextVersion( getCurrentVersion(), increment, preid );
if ( ! semver.valid( version ) ) {
logResult( `The supplied version string ${ chalk.bold( version ) } is invalid.`, 'error' );
- 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 output_notice
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function output_notice( $notice_id ) {
if ( current_user_can( 'manage_options' ) ) {
$notice = self::get_notice( $notice_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
Function handle_manage_addons
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function handle_manage_addons() {
// phpcs:disable WordPress.Security.NonceVerification.Missing -- nonce is verified in $this->handle_actions() method.
$actions = apply_filters(
- 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 handle_ajax
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function handle_ajax( $request ) {
if ( ! $request['course_id'] || ! current_user_can( 'edit_course', $request['course_id'] ) ) {
return 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
Function llms_create_page
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function llms_create_page( $slug, $title = '', $content = '', $option = '' ) {
$option_val = get_option( $option );
// See if there's a valid page already stored for the option we're trying to create.
- 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 output_tfoot_html
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function output_tfoot_html() {
?>
<tfoot>
<tr>
<th colspan="<?php echo esc_attr( $this->get_columns_count() ); ?>">
- 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 get_correct_choice
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function get_correct_choice() {
$correct = false;
if ( $this->supports( 'choices' ) && $this->supports( 'grading', 'auto' ) ) {
- 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 instructors_mb_store
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function instructors_mb_store( $request ) {
// validate required params.
if ( ! isset( $request['store_action'] ) || ! isset( $request['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
Function get_field_html
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function get_field_html() {
/**
* Allow 3rd parties to create custom field types or their own field HTML methods.
*
- 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_get_picture_choice_question_cols
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function llms_get_picture_choice_question_cols( $num_choices ) {
/**
* Allow 3rd parties to override this function with a custom number of columns.
*
- 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 Edit
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Edit = ( props ) => {
const { attributes, setAttributes } = props;
const blockProps = useBlockProps();
const isLlmsPostType = useLlmsPostType();
const courseOptions = usePostOptions();
Method get_achievements_by_post
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_achievements_by_post( $post_ids, $include_children = true ) {
if ( ! is_array( $post_ids ) ) {
$post_ids = array( $post_ids );
}
Method output_section
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function output_section( $section, $which ) {
$url = false;
if ( 'previous' === $which ) {
Method output
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function output() {
$tabs = apply_filters(
'llms_admin_page_status_tabs',
array(