learningworks/moodle-block_lw_courses

View on GitHub

Showing 169 of 169 total issues

The function block_lw_courses_get_sorted_courses() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
Open

function block_lw_courses_get_sorted_courses($showallcourses = false) {
    global $USER;

    $limit = block_lw_courses_get_max_user_courses($showallcourses);

Severity: Minor
Found in locallib.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

Rule doesn't have all its properties in alphabetical order.
Open

.block_lw_courses .lw_courses_list .coursebox:not(.span12) .course_title {
Severity: Minor
Found in styles.css by csslint

Using width with border can sometimes make elements larger than you expect.
Open

    border: 2px solid #fff;
Severity: Minor
Found in styles.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.block_lw_courses .lw_courses_list .coursebox:not(.span12):hover .teacher_names,
Severity: Minor
Found in styles.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.lw_courses_list .coursebox:not(.span12):hover .course_content .summary .autolink {
Severity: Minor
Found in styles.css by csslint

Adjoining classes: .lw_courses_list .coursebox.span4:nth-child(3n+1)
Open

.lw_courses_list .coursebox.span4:nth-child(3n+1) {
Severity: Minor
Found in styles.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.block_lw_courses .coursebox:not(.span12) .image_wrap {
Severity: Minor
Found in styles.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.block_lw_courses .coursebox.list .course_image_embed {
Severity: Minor
Found in styles.css by csslint

Adjoining classes: .block_lw_courses .coursebox.list .categorypath
Open

.block_lw_courses .coursebox.list .categorypath,
Severity: Minor
Found in styles.css by csslint

Adjoining classes: .block_lw_courses .coursebox.list .activity_info
Open

.block_lw_courses .coursebox.list .activity_info {
Severity: Minor
Found in styles.css by csslint

Adjoining classes: .block_lw_courses .coursebox.list .box.flush
Open

.block_lw_courses .coursebox.list .box.flush {
Severity: Minor
Found in styles.css by csslint

Adjoining classes: .block_lw_courses .lw_courses_list .coursebox.span12
Open

.block_lw_courses .lw_courses_list .coursebox.span12 {
Severity: Minor
Found in styles.css by csslint

Adjoining classes: .block_lw_courses .lw_courses_list .coursebox.span12 .title a
Open

.block_lw_courses .lw_courses_list .coursebox.span12 .title a {
Severity: Minor
Found in styles.css by csslint

Adjoining classes: .lw_courses_list .coursebox.span6:nth-child(2n+1)
Open

.lw_courses_list .coursebox.span6:nth-child(2n+1) {
Severity: Minor
Found in styles.css by csslint

Adjoining classes: .block_lw_courses .coursebox.list .course_title
Open

    .block_lw_courses .coursebox.list .course_title,
Severity: Minor
Found in styles.css by csslint

Adjoining classes: .block_lw_courses .coursebox.list .teacher_names
Open

    .block_lw_courses .coursebox.list .teacher_names,
Severity: Minor
Found in styles.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.block_lw_courses .categorypath {
Severity: Minor
Found in styles.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.block_lw_courses .coursebox.span12 .image_wrap {
Severity: Minor
Found in styles.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.block_lw_courses .coursebox:not(.span12) .course_image_embed {
Severity: Minor
Found in styles.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.block_lw_courses .lw_courses_list .coursebox:not(.span12) .title {
Severity: Minor
Found in styles.css by csslint
Severity
Category
Status
Source
Language