Showing 1,420 of 1,425 total issues
Method init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init( $args ) {
$this->student = new WP_User( $args['person_id'] );
$this->email_post = get_post( $args['email_id'] );
Method install
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function install() {
if ( ! is_blog_installed() ) {
return;
}
Method get_order_data
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function get_order_data( $order ) {
$data = array();
$props = self::get_order_data_props( 'export' );
Method prepare_value
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function prepare_value() {
// Never autoload passwords and or fields with an explicit value (except radio and checkbox).
if ( 'password' === $this->settings['type'] || ! empty( $this->settings['value'] && ! in_array( $this->settings['type'], array( 'checkbox', 'radio' ), true ) ) ) {
return;
Method includes_admin
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function includes_admin() {
// Functions.
require_once LLMS_PLUGIN_DIR . 'includes/admin/llms.functions.admin.php';
Method user_can_manage_user
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function user_can_manage_user( $user_id, $edit_id ) {
$user = get_user_by( 'id', $user_id );
/**
Method favorite_object
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function favorite_object() {
// Grab the data if it exists.
$user_action = llms_filter_input_sanitize_string( INPUT_POST, 'user_action' );
$object_id = llms_filter_input( INPUT_POST, 'object_id', FILTER_SANITIZE_NUMBER_INT );
Method show_notice
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_notice() {
$notice_id = sprintf( 'v%s-welcome-msg', str_replace( array( '.', '-' ), '', _get_db_version() ) );
$get_started_link = admin_url( 'post-new.php?post_type=llms_certificate' );
Method llms_agree_to_terms_form_field
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function llms_agree_to_terms_form_field( $echo = true ) {
// Because `do_action()` passes empty string.
if ( '' === $echo ) {
$echo = true;
Method course_info
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function course_info( $atts ) {
extract(
shortcode_atts(
array(
'date_format' => 'F j, Y', // If $type is date, a custom date format can be supplied.
Method lifterlms_template_student_dashboard_my_certificates
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function lifterlms_template_student_dashboard_my_certificates( $preview = false ) {
$student = llms_get_student();
if ( ! $student ) {
return;
Method lifterlms_template_student_dashboard_my_achievements
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function lifterlms_template_student_dashboard_my_achievements( $preview = false ) {
$student = llms_get_student();
if ( ! $student ) {
return;
Similar blocks of code found in 2 locations. Consider refactoring. Open
array(
'type' => 'select',
'label' => __( 'Courses', 'lifterlms' ),
'desc' => __( 'Limit coupon to the following courses.', 'lifterlms' ),
'id' => $this->prefix . 'coupon_courses',
- 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 102.
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(
'type' => 'select',
'label' => __( 'Membership', 'lifterlms' ),
'desc' => __( 'Limit coupon to the following memberships.', 'lifterlms' ),
'id' => $this->prefix . 'coupon_membership',
- 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 102.
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
if ($( '#review_title' ).val() === '') {
$( '#review_title_error' ).show( 'swing' );
} else {
$( '#review_title_error' ).hide( 'swing' );
}
- 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 56.
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
if ($( '#review_text' ).val() === '') {
$( '#review_text_error' ).show( 'swing' );
} else {
$( '#review_text_error' ).hide( 'swing' );
}
- 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 56.
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 check_strength
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
check_strength: function() {
var $pass_field = this.$pass.closest( '.llms-form-field' ),
$conf_field = this.$conf && this.$conf.length ? this.$conf.closest( '.llms-form-field' ) : null,
pass_length = this.$pass.val().length,
Function init_relationships
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
init_relationships: function( options ) {
var rels = this.get_relationships();
// initialize parent relationships
Function processResults
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
processResults: function( data, params ) {
// recursive function for creating
function map_data( items ) {
Function add_existing_assignment_click
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
add_existing_assignment_click: function( event ) {
event.preventDefault();
if ( this.is_addon_available() ) {