Attached is a patch to standardize the json output for the Audit content option. This patch converts the text/markup rendered currently with the --json option for both the summary and the detail (--detail) reports.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lhridley’s picture

lhridley’s picture

Status: Active » Needs review
lhridley’s picture

FluxSauce’s picture

Status: Needs review » Needs work

Thanks for the patch! Similar feedback to the others.

FILE: /Users/jon/projects/site_audit/Check/Content/ContentTypes.php
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 39 | ERROR | Expected "if (...) {\n"; found "if(...) {\n"
--------------------------------------------------------------------------------
UPGRADE TO PHP_CODESNIFFER 2.0 TO FIX ERRORS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /Users/jon/projects/site_audit/Check/Content/DuplicateTitles.php
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 70 | WARNING | A comma should follow the last multiline array item. Found:
    |         | $count
--------------------------------------------------------------------------------
UPGRADE TO PHP_CODESNIFFER 2.0 TO FIX ERRORS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /Users/jon/projects/site_audit/Check/Content/FieldCount.php
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 63 | WARNING | A comma should follow the last multiline array item. Found: )
--------------------------------------------------------------------------------
UPGRADE TO PHP_CODESNIFFER 2.0 TO FIX ERRORS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /Users/jon/projects/site_audit/Check/Content/FieldInstances.php
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 2 WARNING(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
 62 | WARNING | A comma should follow the last multiline array item. Found: )
 63 | WARNING | A comma should follow the last multiline array item. Found: )
--------------------------------------------------------------------------------
UPGRADE TO PHP_CODESNIFFER 2.0 TO FIX ERRORS AUTOMATICALLY
--------------------------------------------------------------------------------

Same feedback on consolidation applies as well; just instantiate $ret_val as an array and populate it.

FieldInstances - doesn't look like that array is constructed properly, are you sure about that?

ContentTypeCounts - simplify and reduce nesting. For example:

      foreach ($this->registry['content_type_counts'] as $content_type => $count) {
        $ret_val['Content Type Counts'][$content_type] = $count;
      }

Also, you're overwriting $ret_val which included the total count from earlier.

Will do a more thorough functional review after these changes are implemented.