includes/class-llms-engagement-handler.php
Method dupcheck
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function dupcheck( $type, $user_id, $template_id, $related_id = '', $engagement_id = null ) {
$student = llms_get_student( $user_id );
$query = new LLMS_Awards_Query(
Method create_actions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static function create_actions( $type, $user_id, $generated_id, $related_id = '', $engagement_id = null ) {
Method create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static function create( $type, $user_id, $template_id, $related_id = '', $engagement_id = null ) {
Method do_deprecated_filter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static function do_deprecated_filter( $args, $init_args, $type, $deprecated, $replacement ) {
Method can_process
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static function can_process( $type, $user_id, $template_id, $related_id = '', $engagement_id = null ) {
Method dupcheck
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static function dupcheck( $type, $user_id, $template_id, $related_id = '', $engagement_id = null ) {
Function can_process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private static function can_process( $type, $user_id, $template_id, $related_id = '', $engagement_id = null ) {
/**
* Skip engagement processing checks and force engagements to process.
*
- 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 handle_email
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function handle_email( $args ) {
$can_process = self::can_process( 'email', ...$args );
if ( true !== $can_process ) {
return $can_process;
- 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"