Skip to content

Overview "Average Class Length" and "Average Method Length" Display NaN #273

@DPStokesNZ

Description

@DPStokesNZ

phpDox (0.8.1.1) Overview page displays Average Class Length and Average Method Length as NaN in Class section.

phpdox/templates/html/index.xsl appears to be attempting to use items llocByNoc and llocByNom from the phploc.xml file, however the the appropriate items (as generated by phploc 3.0.0) are classLlocAvg (Average Class Length) and methodLlocAvg (Average Method Length).

Excerpt from index.xsl:

 <td class="indent">Average Class Length</td>
 <td class="nummeric"><xsl:value-of select="round($phploc/pdx:llocByNoc)" /></td>
 ...
 <td class="indent">Average Method Length</td>
 <td class="nummeric"><xsl:value-of select="round($phploc/pdx:llocByNom)" /></td>

Output from phploc log:

   ....
   [phploc]       Average Class Length                           9
   [phploc]         Minimum Class Length                         0
   [phploc]         Maximum Class Length                        53
   [phploc]       Average Method Length                          2
   [phploc]         Minimum Method Length                        1
   [phploc]         Maximum Method Length                       12

Excerpt from phploc.xml:

# grep -Ern 'classLlocAvg|methodLlocAvg|llocByNoc|llocByNom' .
./workspace/app/build/logs/phploc.xml:47:  <classLlocAvg>8.65</classLlocAvg>
./workspace/app/build/logs/phploc.xml:53:  <methodLlocAvg>2.1746031746032</methodLlocAvg>

Suggest an update to index.xsl is required?

Regards,
Duncan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions