File model.llms.question.php
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* LifterLMS Quiz Question Model
*
* @package LifterLMS/Models/Classes
LLMS_Question
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class LLMS_Question extends LLMS_Post_Model {
/**
* Database post type name
*
Function get_correct_choice
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function get_correct_choice() {
$correct = false;
if ( $this->supports( 'choices' ) && $this->supports( 'grading', 'auto' ) ) {
- 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
Method get_creation_args
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_creation_args( $args = null ) {
// Allow nothing to be passed in.
if ( empty( $args ) ) {
$args = array();
Function grade
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function grade( $answer ) {
$question_type = $this->get( 'question_type' );
/**
- 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 get_image
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function get_image( $size = 'full', $unused = null ) {
$url = '';
if ( $this->has_image() ) {
- 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 supports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function supports( $feature, $option = null ) {
$ret = false;
$type = $this->get_question_type();
- 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 get_creation_args
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function get_creation_args( $args = null ) {
// Allow nothing to be passed in.
if ( empty( $args ) ) {
$args = array();
- 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"