Showing 1,420 of 1,425 total issues
Method output
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function output() {
if ( is_wp_error( $this->get_data() ) ) {
esc_html_e( 'There was an error retrieving add-ons. Please try again.', 'lifterlms' );
return;
Method ___get
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function ___get( $key, $raw = false ) {
// Force numeric id and prevent filtering on the id.
if ( 'id' === $key ) {
Method parse_properties_to_set
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parse_properties_to_set( $model_array ) {
$llms_post = array(
'post' => array(),
'meta' => array(),
Method quiz_start
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function quiz_start( $request ) {
$err = new WP_Error();
$student = llms_get_student();
Method remove_membership_level
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function remove_membership_level( $membership_id, $status = 'expired', $delete = false ) {
// Remove the user from the membership level.
$membership_levels = $this->get_membership_levels();
$key = array_search( $membership_id, $membership_levels );
Similar blocks of code found in 2 locations. Consider refactoring. Open
array(
'default' => 'menu_order',
'desc' => __( 'Determines the display order for courses on the courses page.', 'lifterlms' ),
'id' => 'lifterlms_shop_ordering',
'options' => array(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 115.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
echo paginate_links(
array(
'base' => str_replace( 999999, '%#%', esc_url( get_pagenum_link( 999999 ) ) ),
'format' => '?page=%#%',
'total' => $pagination['max'],
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 115.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
$pagination = paginate_links(
array(
'base' => str_replace( 999999, '%#%', esc_url( get_pagenum_link( 999999 ) ) ),
'format' => '?page=%#%',
'total' => $pagination['max'],
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 115.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
array(
'default' => 'menu_order',
'desc' => __( 'Determines the display order for items on the memberships page.', 'lifterlms' ),
'id' => 'lifterlms_memberships_ordering',
'options' => array(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 115.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function Grading
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Grading = function() {
/**
* Bind DOM events
*
Function controller_change
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.controller_change = function( $el ) {
var id = $el.attr( 'data-controller-id' ),
val = $el.val(),
$form = $el.closest( '.llms-access-plan' ),
Method is_authorized_to_view
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function is_authorized_to_view( $user_id, $media_id ): ?bool {
if ( ! is_numeric( $media_id ) || ! intval( $media_id ) ) {
return null;
}
Method output
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function output() {
global $post;
if ( isset( $this->field['meta'] ) ) {
Method get_notification_settings
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function get_notification_settings( $controller ) {
$settings = array();
// Setup vars.
Method llms_update_450_migrate_events_open_sessions
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function llms_update_450_migrate_events_open_sessions() {
$limit = 200;
$skip = get_transient( 'llms_450_skipper_events_open_sessions' );
if ( ! $skip ) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
/**
* Meta box Field: Button
*
* @package LifterLMS/Admin/PostTypes/MetaBoxes/Fields/Classes
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 114.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
/**
* Meta box Field: Search
*
* @package LifterLMS/Admin/PostTypes/MetaBoxes/Fields/Classes
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 114.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function bind
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
bind: function() {
var self = this;
this.$outlines.each( function() {
Method save
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function save( $post_id ) {
if ( ! llms_verify_nonce( 'lifterlms_meta_nonce', 'lifterlms_save_data' ) ) {
return;
}
Method get_basic_html
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function get_basic_html() {
// Setup html classes.
$classes = array(
'llms-notification',