Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Mar 19, 2018
2 parents 48f0ee1 + 831bdc2 commit e70f2f3
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/main/resources/org/jpeek/metrics/SCOM.xsl
Expand Up @@ -57,6 +57,18 @@ SOFTWARE.
<xsl:variable name="m" select="count($methods)"/>
<xsl:variable name="attributes" select="attributes/attribute/text()"/>
<xsl:variable name="a" select="count($attributes)"/>
<xsl:variable name="SCOM_minK">
<xsl:choose>
<xsl:when test="$m = 0 or $m = 1 or $a = 0">
<xsl:text>NaN</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="x" select="($m - 1) div $a"/>
<xsl:variable name="S" select="0.5 * (1 + floor($x)) * (($x - floor($x)) + $m - 1)"/>
<xsl:value-of select="$S * (2 div ($m * ($m - 1) * $a))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="pairs">
<xsl:for-each select="$methods">
<xsl:variable name="method" select="."/>
Expand Down Expand Up @@ -125,11 +137,6 @@ SOFTWARE.
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="@*"/>
<!--
@todo #68:30min Calculate SCOM_min as per page 86 of the paper (I don't
know what the "int" function means). This value can be used as a guide
to determine whether a class needs to be split into several classes.
-->
<vars>
<var id="m">
<xsl:value-of select="$m"/>
Expand All @@ -140,6 +147,9 @@ SOFTWARE.
<var id="a">
<xsl:value-of select="$a"/>
</var>
<var id="SCOM_minK">
<xsl:value-of select="$SCOM_minK"/>
</var>
</vars>
</xsl:copy>
</xsl:template>
Expand Down

1 comment on commit e70f2f3

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on e70f2f3 Mar 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 68-03d5665d disappeared from src/main/resources/org/jpeek/metrics/SCOM.xsl, that's why I closed #142. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

Please sign in to comment.