Showing 1,420 of 1,425 total issues
Method related_courses
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function related_courses( $atts ) {
ob_start();
if ( isset( $atts['category'] ) ) {
Method get_sidebars
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get_sidebars() {
$sidebars = array(
apply_filters(
'lifterlms_register_lesson_sidebar',
Similar blocks of code found in 4 locations. Consider refactoring. Open
protected function set_subscriber_options( $type ) {
$options = array();
switch ( $type ) {
- 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 105.
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 4 locations. Consider refactoring. Open
protected function set_subscriber_options( $type ) {
$options = array();
switch ( $type ) {
- 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 105.
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 4 locations. Consider refactoring. Open
protected function set_subscriber_options( $type ) {
$options = array();
switch ( $type ) {
- 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 105.
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 4 locations. Consider refactoring. Open
protected function set_subscriber_options( $type ) {
$options = array();
switch ( $type ) {
- 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 105.
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 init
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.init = function( skip_dep_checks ) {
var self = this;
self.$plans = $( '#llms-access-plans' );
Method init
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function init() {
// For the cron.
add_action( $this->schedule_hook, array( $this, 'dispatch_calc' ), 10, 1 );
Function bind
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.bind = function() {
var self = this;
if ( $( '.llms-image-field-upload' ).length ) {
Method send_data
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function send_data( $force = false ) {
// Don't trigger during AJAX Requests.
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
return;
Method save_remaining_payments
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function save_remaining_payments( $order ) {
// If it's not a payment plan or cannot modify recurring payment, don't proceed.
if ( ! $order->has_plan_expiration() || ! $order->supports_modify_recurring_payments() ) {
return -1;
Method get_nav_items
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function get_nav_items() {
$items = array();
foreach ( LLMS_Student_Dashboard::get_tabs() as $id => $data ) {
Method restricted_by_membership
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function restricted_by_membership( $info ) {
$membership_id = $info['restriction_id'];
// Do nothing if we don't have a membership id.
Method output_notice
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function output_notice( $notice_id ) {
if ( current_user_can( 'manage_options' ) ) {
$notice = self::get_notice( $notice_id );
Method handle
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handle() {
$options_to_wipe = array(
'lifterlms_registration_generate_username',
'lifterlms_registration_password_strength',
Method output
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function output() {
// Single student.
if ( isset( $_GET['student_id'] ) ) {
Method output_widget
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function output_widget( $args = array() ) {
$args = self::get_output_widget_args( $args );
// Only these data types can make comparisons.
Method generate_export_file
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generate_export_file( $args = array(), $filename = null, $type = 'csv' ) {
// We only support CSVs and don't allow fakers.
if ( ! empty( $filename ) && pathinfo( $filename, PATHINFO_EXTENSION ) !== $type ) {
return false;
Method call
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function call( $resource, $data, $method = null ) {
$method = is_null( $method ) ? $this->default_request_method : $method;
// setup headers.
Method get_content_html
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function get_content_html() {
add_filter( 'llms_user_info_shortcode_user_id', array( $this, 'set_shortcode_user' ) );
$codes = apply_filters(