Showing 1,389 of 1,394 total issues
File _Editable.js
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Handles UX and Events for inline editing of views
*
* Use with a Model's View
* Allows editing model.title field via .llms-editable-title elements
File llms.abstract.notification.view.php
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Notification View Abstract
*
* @package LifterLMS/Abstracts/Classes
Function llms_update_300_update_orders
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function llms_update_300_update_orders() {
$args = array(
'post_type' => array( 'llms_order' ),
'posts_per_page' => -1,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function llms_current_user_can
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function llms_current_user_can( $cap, $obj_id = null ) {
$caps = LLMS_Roles::get_all_core_caps();
$grant = false;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Similar blocks of code found in 2 locations. Consider refactoring. Open
it( 'should return errors when an array is not submitted for the attributions list', () => {
const { valid, errors, warnings } = getChangelogValidationIssues( { attributions: 1, type: 'changed', significance: 'patch', entry: 'Valid.' }, false );
expect( valid ).toStrictEqual( false );
expect( warnings ).toStrictEqual( [] );
- 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
it( 'should return errors when an array is not submitted for the links list', () => {
const { valid, errors, warnings } = getChangelogValidationIssues( { links: 1, type: 'changed', significance: 'patch', entry: 'Valid.' }, false );
expect( valid ).toStrictEqual( false );
expect( warnings ).toStrictEqual( [] );
- 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
Method get_transactions
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_transactions( $args = array() ) {
extract(
wp_parse_args(
$args,
Method get_tabs
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get_tabs() {
$tabs = array(
'dashboard' => array(
'content' => 'lifterlms_template_student_dashboard_home',
LLMS_Access_Plan
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class LLMS_Access_Plan extends LLMS_Post_Model {
/**
* Map of meta properties => type.
*
File Sync.js
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Sync builder data to the server
*
* @since 3.16.0
* @version 4.17.0
File class-llms-privacy-exporters.php
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* LifterLMS Privacy Exporter
*
* @package LifterLMS/Privacy/Classes
Method save_fields
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function save_fields( $settings ) {
// phpcs:disable WordPress.Security.NonceVerification.Missing -- nonce is checked in self::save().
if ( empty( $_POST ) ) {
return false;
Method get_data
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_data( $key, $data ) {
$quiz = llms_get_post( $data );
switch ( $key ) {
Method output
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function output() {
global $post;
$course_id = isset( $_GET['course_id'] ) ? absint( $_GET['course_id'] ) : null;
File abstract.llms.payment.gateway.php
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* LifterLMS Payment Gateways Abstract
*
* @package LifterLMS/Abstracts/Classes
Similar blocks of code found in 2 locations. Consider refactoring. Open
$strings = array(
'active' => __( 'Active', 'lifterlms' ),
'inactive' => __( 'Inactive', 'lifterlms' ),
- 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 153.
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
return array(
'archive-course' => esc_html__( 'LifterLMS Course Catalog Template', 'lifterlms' ),
'archive-llms_membership' => esc_html__( 'LifterLMS Membership Catalog Template', 'lifterlms' ),
'single-certificate' => esc_html__( 'LifterLMS Certificate Template', 'lifterlms' ),
'single-no-access' => esc_html__( 'LifterLMS Single Template Access Restricted', 'lifterlms' ),
- 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 153.
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
File class.llms.settings.accounts.php
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Admin Settings Page, Accounts Tab
*
* @package LifterLMS/Admin/Settings/Classes
Method set_order_data_query
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function set_order_data_query( $args = array() ) {
extract(
wp_parse_args(
$args,
LLMS_Question
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class LLMS_Question extends LLMS_Post_Model {
/**
* Database post type name
*