Showing 1,420 of 1,425 total issues
Method get_sibling_lesson_query
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_sibling_lesson_query( $direction ) {
$curr_position = $this->get( 'order' );
// First cannot have a previous.
Method modify_paginate_links
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function modify_paginate_links( $link ) {
global $wp_rewrite;
// With ugly permalinks actually the whole BuddyPress member profile page doesn't work.
Method get_test_settings
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_test_settings( $type ) {
$query = new WP_Query(
array(
'post_type' => 'llms_transaction',
Method migrate_award_templates
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function migrate_award_templates() {
$per_page = llms_update_util_get_items_per_page();
$query = new \WP_Query(
Similar blocks of code found in 2 locations. Consider refactoring. Open
condition: function() {
return ( ! this.get_course() || 'yes' !== this.get_course().get( 'lesson_drip' ) || ! this.get_course().get( 'drip_method' ) );
},
- 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 66.
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
shift_down: function( e ) {
e.preventDefault();
var index = this.model.collection.indexOf( this.model );
this.shift( index, index + 1 );
- 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 66.
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
shift_up: function( e ) {
e.preventDefault();
var index = this.model.collection.indexOf( this.model );
this.shift( index, index - 1 );
- 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 66.
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
condition: function() {
return ( ! this.get_course() || 'yes' !== this.get_course().get( 'lesson_drip' ) || ! this.get_course().get( 'drip_method' ) );
},
- 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 66.
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 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Edit( props ) {
const [ isOpen, setOpen ] = useState( false ),
openModal = () => setOpen( true ),
closeModal = () => setOpen( false ),
{ value, onChange } = props;
Function usePostOptions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const usePostOptions = ( postType = 'course' ) => {
const { posts, currentPostType } = useSelect( ( select ) => {
return {
posts: select( 'core' ).getEntityRecords( 'postType', postType ),
currentPostType: select( 'core/editor' )?.getCurrentPostType(),
Function get_chart_data_object
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.get_chart_data_object = function() {
var self = this,
max_for_days = ( ( 1000 * 3600 * 24 ) * 30 ) * 4, // 4 months in seconds
diff = this.get_date_diff(),
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
this.$el.html( this.template( this.model ) );
if ( this.model.get( 'question_type').get( 'choices' ) ) {
Function do_ajax_save
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function do_ajax_save() {
// prevent simultaneous saves
if ( self.saving ) {
return;
Function Edit
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Edit = ( props ) => {
const { attributes } = props;
const blockProps = useBlockProps();
const courseOptions = usePostOptions();
Method manage_columns
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function manage_columns( $column, $post_id ) {
switch ( $column ) {
case 'trigger':
Method output
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function output() {
$order = llms_get_post( $this->post );
if ( llms_parse_bool( $order->get( 'anonymized' ) ) ) {
Method save_mod_rewrite_rules
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save_mod_rewrite_rules() {
// TODO: Different for multi-site?
if ( false === get_transient( 'lifterlms_check_media_protection_files' ) ) {
global $wp_filesystem;
Method get_gateway_table_html
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_gateway_table_html() {
$gateways = llms()->payment_gateways()->get_payment_gateways();
usort( $gateways, array( $this, 'sort_gateways' ) );
Method get_data
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_data( $key, $lesson ) {
switch ( $key ) {
case 'actions':
Method set_columns
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function set_columns() {
$cols = array(
'id' => array(
'exportable' => true,
'sortable' => true,