Showing 1,420 of 1,425 total issues
Method get_data
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_data( $key, $data ) {
$course = llms_get_post( $data );
switch ( $key ) {
Method get_orders
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_orders( $params = array() ) {
$params = wp_parse_args(
$params,
array(
Method convert_to_hours_minutes_string
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function convert_to_hours_minutes_string( $time ) {
$decimal_part = $time - floor( $time );
settype( $time, 'integer' );
if ( $time < 1 ) {
return;
Method get_test_settings
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_test_settings( $type ) {
if ( 'email' !== $type ) {
return;
}
Method llms_is_post_restricted_by_membership
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function llms_is_post_restricted_by_membership( $post_id, $user_id = null ) {
// don't check these posts types.
$skip = apply_filters(
'llms_is_post_restricted_by_membership_skip_post_types',
Method set_merge_data
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function set_merge_data( $code ) {
$attempt = new LLMS_Quiz_Attempt( $this->notification->get( 'post_id' ) );
if ( ! $attempt->exists() ) {
return '';
Similar blocks of code found in 2 locations. Consider refactoring. Open
array(
'class' => 'llms-select2-post',
'custom_attributes' => array(
'data-allow-clear' => true,
'data-post-type' => 'page',
- 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 110.
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(
'class' => 'llms-select2-post',
'custom_attributes' => array(
'data-allow-clear' => true,
'data-post-type' => 'llms_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 110.
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
<PanelRow>
<TextControl
label={ __( 'Login redirect URL', 'lifterlms' ) }
value={ attributes.login_redirect }
onChange={ ( value ) => setAttributes( {
- 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 64.
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
<PanelRow>
<TextControl
label={ __( 'Login redirect URL', 'lifterlms' ) }
value={ attributes.redirect }
onChange={ ( value ) => setAttributes( {
- 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 64.
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 Edit
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Edit = ( props ) => {
const { attributes } = props;
const blockProps = useBlockProps();
const courseOptions = usePostOptions();
Function Edit
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Edit = ( props ) => {
const { attributes } = props;
const blockProps = useBlockProps();
const courseOptions = usePostOptions();
Function Edit
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Edit = ( props ) => {
const { attributes } = props;
const blockProps = useBlockProps();
const courseOptions = usePostOptions();
Function save_plans
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.save_plans = function() {
var self = this;
self.$plans.find( '.llms-access-plan' ).not( '#llms-new-access-plan-model' ).each( function() {
Function setupPlugins
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupPlugins( plugins, css, prefix, cleanAfterEveryBuildPatterns ) {
// Modify the CleanWebpackPlugin's cleanAfterEveryBuildPatterns config.
if ( cleanAfterEveryBuildPatterns.length ) {
plugins = plugins.filter( ( plugin ) => {
if ( 'CleanWebpackPlugin' === plugin.constructor.name ) {
Method validate_upload
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validate_upload( $file ) {
if ( ! empty( $file['error'] ) ) {
switch ( $file['error'] ) {
Method output_instructors_assistant_fields
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function output_instructors_assistant_fields( $user ) {
if ( is_numeric( $user ) || is_a( $user, 'WP_User' ) ) {
$instructor = llms_get_instructor( $user );
$selected = $instructor->get( 'parent_instructors' );
Method get_enrollment_data
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function get_enrollment_data( $post_id, $student, $post_type_object ) {
$data = array();
$data[] = array(
Method get_test_settings
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_test_settings( $type ) {
if ( 'email' !== $type ) {
return;
}
Method llms_paginate_links
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function llms_paginate_links( $args ) {
global $wp_query;
$args = wp_parse_args(