modules/custom/pasta/lib/PastaValidationReportQueue.php

Summary

Maintainability
A
1 hr
Test Coverage

Method processData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
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.
Severity: Minor
Found in modules/custom/pasta/lib/PastaValidationReportQueue.php - About 1 hr to fix

    Function processData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    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.
    Severity: Minor
    Found in modules/custom/pasta/lib/PastaValidationReportQueue.php - About 25 mins to fix

    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

    }

    Missing class doc comment
    Open

    class PastaValidationQueue extends SystemQueue {

    If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
    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);

    Missing function doc comment
    Open

      public function enqueue($node) {

    Missing function doc comment
    Open

      public static function processData($data) {

    Expected 1 blank line before function; 0 found
    Open

      public static function get($name = 'PastaValidationQueue') {

    Missing function doc comment
    Open

      public static function get($name = 'PastaValidationQueue') {

    Expected 1 blank line after function; 0 found
    Open

      }

    There are no issues that match your filters.

    Category
    Status