modules/custom/pasta/lib/PastaValidationReportQueue.php
Method processData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function processData($data) {
$seen_nids = &drupal_static('pasta_validation_report_queue_process', array());
// Ensure that on the same request we don't try to fetch the validation
// report for the same node more than once.
Function processData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function processData($data) {
$seen_nids = &drupal_static('pasta_validation_report_queue_process', array());
// Ensure that on the same request we don't try to fetch the validation
// report for the same node more than once.
- 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
The closing brace for the class must have an empty line before it Open
Open
}
- Exclude checks
Missing class doc comment Open
Open
class PastaValidationQueue extends SystemQueue {
- Exclude checks
If the line declaring an array spans longer than 80 characters, each element should be broken into its own line Open
Open
watchdog('pasta', 'Failed to fetch EML validation results for node @nid. Made @attempts attempts in !interval.', array('@nid' => $data['nid'], '@attempts' => $data['attempts'], '!interval' => format_interval($interval)), WATCHDOG_ERROR);
- Exclude checks
Missing function doc comment Open
Open
public function enqueue($node) {
- Exclude checks
Missing function doc comment Open
Open
public static function processData($data) {
- Exclude checks
Expected 1 blank line before function; 0 found Open
Open
public static function get($name = 'PastaValidationQueue') {
- Exclude checks
Missing function doc comment Open
Open
public static function get($name = 'PastaValidationQueue') {
- Exclude checks
Expected 1 blank line after function; 0 found Open
Open
}
- Exclude checks