Showing 1,420 of 1,425 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
'checkout' => array(
'name' => __( 'Checkout', 'lifterlms' ),
'description' => __( 'Handles new user registration and existing user information updates during checkout and enrollment.', 'lifterlms' ),
'title' => __( 'Billing Information', 'lifterlms' ),
'template' => LLMS_Form_Templates::get_template( 'checkout' ),
- 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 118.
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
'registration' => array(
'name' => __( 'Registration', 'lifterlms' ),
'description' => __( 'Handles new user registration and existing user information updates for open registration on the student dashboard and wherever the [lifterlms_registration] shortcode is used.', 'lifterlms' ),
'title' => __( 'Register', 'lifterlms' ),
'template' => LLMS_Form_Templates::get_template( 'registration' ),
- 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 118.
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
views: {
elements: {
class: Elements,
instance: null,
state: 'builder',
- 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 72.
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
views: {
lesson: {
class: LessonEditor,
instance: null,
state: 'lesson',
- 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 72.
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 render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
this.$el.html( this.template( this.model ) );
// Render the quiz builder.
Method set_columns
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function set_columns() {
$cols = array(
'id' => array(
'sortable' => true,
'title' => __( 'ID', 'lifterlms' ),
Method block_editor_assets_for_certificates
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function block_editor_assets_for_certificates() {
llms()->assets->enqueue_script( 'llms-admin-certificate-editor' );
$settings = array(
Method get_data
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_data( $key, $certificate ) {
// Handle old object being passed in.
if ( ! is_a( $certificate, 'LLMS_User_Certificate' ) && property_exists( $certificate, 'certificate_id' ) ) {
$certificate = llms_get_certificate( $certificate->certificate_id );
Function Donut
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
LLMS.Donut = function( $el ) {
/**
* Constructor
*
Function getChangelogValidationIssues
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getChangelogValidationIssues( logEntry, formatting = true ) {
const options = getChangelogOptions(),
errors = [],
warnings = [];
Method save
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save( $post_id ) {
if ( ! llms_verify_nonce( 'lifterlms_meta_nonce', 'lifterlms_save_data' ) ) {
return -1;
}
Method get_widget_data
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_widget_data() {
return apply_filters(
'llms_reporting_tab_sales_widgets',
array(
array(
Method schedule_sync
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function schedule_sync( $engagement_template_id ) {
$this->log(
sprintf(
'awarded %1$ss bulk sync for the %1$s template %2$s (#%3$d)',
Method quiz_answer_question
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function quiz_answer_question( $request ) {
$err = new WP_Error();
$student = llms_get_student();
Method get_completed_courses
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_completed_courses( $args = array() ) {
global $wpdb;
$args = array_merge(
Method sql_where
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function sql_where() {
global $wpdb;
$sql = 'WHERE 1';
Method register_post_type
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register_post_type() {
$args = array(
'label' => __( 'LifterLMS Forms', 'lifterlms' ),
'labels' => array(
Method llms_get_certificate_sizes
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function llms_get_certificate_sizes() {
$sizes = array(
// ISO 216 sizes.
'A3' => array(
Function entry
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
config.entry = () => {
try {
const entries = Object.fromEntries(
Object.entries( blockEntries ).map( ( [ key, val ] ) => {
return [ key.replace( 'blocks/', '' ), val ];
Method get_sibling_section_query
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_sibling_section_query( $direction ) {
$sibling_lesson = false;
$curr_section = $this->get_section();