Showing 1,420 of 1,425 total issues
Method set_query
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function set_query() {
global $wpdb;
$dates = $this->get_posted_dates();
Method get_actions_html
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function get_actions_html( $certificate_id ) {
ob_start();
?>
<a class="llms-button-secondary small" href="<?php echo esc_url( get_permalink( $certificate_id ) ); ?>" target="_blank">
<?php esc_html_e( 'View', 'lifterlms' ); ?>
Method set_query
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function set_query() {
global $wpdb;
$dates = $this->get_posted_dates();
Method has_active_subscriptions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function has_active_subscriptions( $use_cache = true ) {
$found = false;
if ( $use_cache ) {
$subscriptions_count = wp_cache_get( $this->get( 'id' ), 'llms_product_subscriptions_count', true, $found );
Method get_content_html
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function get_content_html() {
$this->find = array(
'{site_title}',
'{user_login}',
Method get_count
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_count( $key ) {
$count = 0;
$questions = $this->get_questions();
Method query_associated_posts
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function query_associated_posts( $post_type, $enabled_key, $enabled_value, $list_key ) {
global $wpdb;
// See if we have a cached result first.
Method get_overall_grade
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_overall_grade( $use_cache = true ) {
$grade = null;
// Attempt to pull from the cache first.
Method enroll
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function enroll( $product_id, $trigger = 'unspecified' ) {
/**
* Fires before a user is enrolled into a course or membership.
*
Method sql_where
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function sql_where() {
global $wpdb;
$sql = 'WHERE 1';
Method maybe_add_export_files
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function maybe_add_export_files( $archive_pathname, $archive_url, $html_report_pathname, $request_id ) {
if ( ! class_exists( 'ZipArchive' ) ) {
return;
}
Method get_password_fields
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function get_password_fields() {
$fields = array();
$fields[] = array(
Method prepare_options
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function prepare_options( $raw ) {
$prepared = array();
foreach ( $raw as $key => $val ) {
Method get_lost_password_fields
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get_lost_password_fields() {
$usernames = LLMS_Forms::instance()->are_usernames_enabled();
if ( ! $usernames ) {
Method task
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function task( $notification_id ) {
$this->log( sprintf( 'sending email notification ID #%d', $notification_id ) );
try {
Method get_test_settings
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_test_settings( $type ) {
$query = new WP_User_Query(
array(
'number' => 25,
Method load
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function load() {
$triggers = array(
'achievement_earned',
'certificate_earned',
Similar blocks of code found in 4 locations. Consider refactoring. Open
<?php $i = 1; while ( $i <= 6 ) : ?>
<option value="<?php echo esc_attr( $i ); ?>"<?php selected( $i, ( $plan && 'year' === $period ) ? $plan->get( 'length' ) : '' ); ?>><?php printf( esc_html( _n( 'for %s year', 'for %s years', $i, 'lifterlms' ) ), esc_html( $i ) ); ?></option>
<?php
++$i;
endwhile;
- 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 103.
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
<?php $i = 1; while ( $i <= 90 ) : ?>
<option value="<?php echo esc_attr( $i ); ?>"<?php selected( $i, ( $plan && 'day' === $period ) ? $plan->get( 'length' ) : '' ); ?>><?php printf( esc_html( _n( 'for %s day', 'for %s days', $i, 'lifterlms' ) ), esc_html( $i ) ); ?></option>
<?php
++$i;
endwhile;
- 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 103.
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
<?php $i = 1; while ( $i <= 52 ) : ?>
<option value="<?php echo esc_attr( $i ); ?>"<?php selected( $i, ( $plan && 'week' === $period ) ? $plan->get( 'length' ) : '' ); ?>><?php printf( esc_html( _n( 'for %s week', 'for %s weeks', $i, 'lifterlms' ) ), esc_html( $i ) ); ?></option>
<?php
++$i;
endwhile;
- 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 103.
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