Skip to content

Commit

Permalink
Fixed rul2xml regular expression (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
redLeR1st authored Jun 30, 2020
1 parent 3b7f1a6 commit 95c18b1
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 177 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<p><strong>Enum:</strong> ratio of the number of documented enumerators in the enum +1 if the enum itself is documented to the number of all enumerators in the enum + 1 (the enum itself).</p>
<p><strong>Namespace:</strong> ratio of the number of documented public classes and methods in the namespace to the number of all of its public classes and methods; however, the classes and methods of its subnamespaces are not included.</p>
</description>
<type>VULNERABILITY</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand All @@ -16,7 +15,6 @@
<name>Coupling Between Object classes (CBO) Metric Threshold Violation</name>
<description>&lt;p&gt;&lt;strong&gt;Class, Structure, Union, Interface:&lt;/strong&gt; number of directly used other classes (e.g. by inheritance, function call, type reference, attribute reference). Classes using many other classes highly depend on their environment, so it is difficult to test or reuse them; furthermore, they are very sensitive to the changes in the system.&lt;/p&gt;
</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand All @@ -35,7 +33,6 @@
&lt;p&gt;&lt;strong&gt;Class, Structure, Union:&lt;/strong&gt; ratio of the comment lines of the class (CLOC) to the sum of its comment (CLOC) and logical lines of code (LLOC).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Namespace:&lt;/strong&gt; ratio of the comment lines of the namespace (CLOC) to the sum of its comment (CLOC) and logical lines of code (LLOC).&lt;/p&gt;
</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -303,7 +300,6 @@
&lt;p&gt;&lt;strong&gt;Enum:&lt;/strong&gt; number of enumerators in the enum.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Namespace:&lt;/strong&gt; number of attributes in the namespace; however, attributes of its subnamespaces are not included.&lt;/p&gt;
</description>
<type>CODE_SMELL</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand All @@ -329,7 +325,6 @@
<description>&lt;p&gt;&lt;strong&gt;Class, Structure, Union, Interface:&lt;/strong&gt; number of getter methods in the class, including the inherited ones; however, the getter methods of its nested, anonymous, and local classes are not included. Methods that override abstract methods are not counted.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Namespace:&lt;/strong&gt; number of getter methods in the namespace; however, getter methods of its subnamespaces are not included.&lt;/p&gt;
</description>
<type>CODE_SMELL</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -873,7 +868,6 @@
<name>Weighted Methods per Class (WMC) Metric Threshold Violation</name>
<description>&lt;p&gt;&lt;strong&gt;Class, Structure, Interface:&lt;/strong&gt; complexity of the class expressed as the number of independent control flow paths in it. It is calculated as the sum of the McCabe’s Cyclomatic Complexity (McCC) values of its local methods.&lt;/p&gt;
</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand All @@ -888,15 +882,13 @@
<key>MET_CC</key>
<name>Clone Coverage (CC) Metric Threshold Violation</name>
<description>&lt;b&gt;Method/Function/Union/Enum/class/Structure/Namespace:&lt;/b&gt; ratio of code covered by code duplications in the source code element to the size of the source code element, expressed in terms of the number of syntactic entities (statements, expressions, etc.).&lt;br&gt;&lt;b&gt;Component:&lt;/b&gt; ratio of code covered by code duplications in the component to the size of the component, expressed in terms of the number of syntactic entities (statements, expressions, etc.).</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
<rule>
<key>MET_CCL</key>
<name>Clone Classes (CCL) Metric Threshold Violation</name>
<description>&lt;b&gt;Method/class/package:&lt;/b&gt; number of clone classes having at least one clone instance in the source code element.&lt;br&gt;&lt;b&gt;Component:&lt;/b&gt; number of clone classes having at least one clone instance in the component.</description>
<type>VULNERABILITY</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand All @@ -911,7 +903,6 @@
<key>MET_CE</key>
<name>Clone Embeddedness (CE) Metric Threshold Violation</name>
<description>&lt;b&gt;Clone instance:&lt;/b&gt; sum of incoming and outgoing references (function calls, variable references, type references; different references to the same entity are counted only once) in the code fragment corresponding to the clone instance, weighted with the number of directory changes between the referenced code fragments.&lt;br&gt;&lt;b&gt;Clone class:&lt;/b&gt; sum of CE of the clone instances of the clone class + 1.</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -940,7 +931,6 @@
<key>MET_CLC</key>
<name>Clone Line Coverage (CLC) Metric Threshold Violation</name>
<description>&lt;b&gt;Function/method/class/module/package:&lt;/b&gt; ratio of code covered by code duplications in the source code element to the size of the source code element, expressed in terms of lines of code.&lt;br&gt;&lt;b&gt;Component:&lt;/b&gt; ratio of code covered by code duplications in the component to the size of the component, expressed in terms of lines of code.</description>
<type>CODE_SMELL</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand All @@ -962,7 +952,6 @@
<key>MET_CR</key>
<name>Clone Risk (CR) Metric Threshold Violation</name>
<description>&lt;b&gt;Clone class:&lt;/b&gt; risk index of the existence of the clone class. It is computed as the product of CLLOC, CI, CCO, NCR, and CV.&lt;br&gt;&lt;b&gt;Component:&lt;/b&gt; relative risk index of the existence of code duplications in the component. It is computed as the sum of CR of the clone classes in the component, divided by the total logical lines of code (non-empty, non-comment lines) of the component. It expresses the risk index projected to a non-empty, non-comment line of code in the component.</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -1019,7 +1008,7 @@
}
}&lt;/code&gt;&lt;/pre&gt;
</description>
<type>CODE_SMELL</type>
<type>BUG</type>
<severity>CRITICAL</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -1160,7 +1149,6 @@ foo(++i, ++i);&lt;/code&gt;&lt;/pre&gt;
<name>Access Forwarded</name>
<description>&lt;h3&gt;Cppcheck&lt;/h3&gt;&lt;p&gt;Access of forwarded variable 'v'.&lt;/p&gt;
</description>
<type>VULNERABILITY</type>
<severity>CRITICAL</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -1231,7 +1219,6 @@ foo(++i, ++i);&lt;/code&gt;&lt;/pre&gt;
<name>Access Moved</name>
<description>&lt;h3&gt;Cppcheck&lt;/h3&gt;&lt;p&gt;Access of moved variable 'v'.&lt;/p&gt;
</description>
<type>CODE_SMELL</type>
<severity>CRITICAL</severity>
<tag>sourcemeter</tag>
</rule>
Expand All @@ -1257,7 +1244,7 @@ foo(++i, ++i);&lt;/code&gt;&lt;/pre&gt;
<name>Argument Size</name>
<description>&lt;h3&gt;Cppcheck&lt;/h3&gt;&lt;p&gt;The array 'array' is too small, the function 'function' expects a bigger one.&lt;/p&gt;
</description>
<type>BUG</type>
<type>VULNERABILITY</type>
<severity>CRITICAL</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -2043,7 +2030,7 @@ foo(++i, ++i);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Source: &lt;a href=&quot;http://linux.die.net/man/3/scanf&quot; class=&quot;uri&quot;&gt;http://linux.die.net/man/3/scanf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Source: &lt;a href=&quot;http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/libkern/stdio/scanf.c&quot; class=&quot;uri&quot;&gt;http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/libkern/stdio/scanf.c&lt;/a&gt;&lt;/p&gt;
</description>
<type>BUG</type>
<type>VULNERABILITY</type>
<severity>CRITICAL</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -2158,7 +2145,7 @@ foo(++i, ++i);&lt;/code&gt;&lt;/pre&gt;
<name>Memset Class</name>
<description>&lt;h3&gt;Cppcheck&lt;/h3&gt;&lt;p&gt;Using 'memfunc' on class that contains a classname is unsafe, because constructor, destructor and copy operator calls are omitted. These are necessary for this non-POD type to ensure that a valid object is created.&lt;/p&gt;
</description>
<type>BUG</type>
<type>VULNERABILITY</type>
<severity>BLOCKER</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -2343,7 +2330,6 @@ foo(++i, ++i);&lt;/code&gt;&lt;/pre&gt;
<name>No Destructor</name>
<description>&lt;h3&gt;Cppcheck&lt;/h3&gt;&lt;p&gt;Class 'class' does not have a destructor which is recommended since it has dynamic memory/resource allocation(s).&lt;/p&gt;
</description>
<type>BUG</type>
<severity>MINOR</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -2387,7 +2373,7 @@ foo(++i, ++i);&lt;/code&gt;&lt;/pre&gt;
<name>Null Pointer</name>
<description>&lt;h3&gt;Cppcheck&lt;/h3&gt;&lt;p&gt;Null pointer dereference&lt;/p&gt;
</description>
<type>BUG</type>
<type>VULNERABILITY</type>
<severity>BLOCKER</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -2764,7 +2750,6 @@ foo(++i, ++i);&lt;/code&gt;&lt;/pre&gt;
<name>Shift By Negative</name>
<description>&lt;h3&gt;Cppcheck&lt;/h3&gt;&lt;p&gt;Shifting by a negative value is undefined behaviour&lt;/p&gt;
</description>
<type>CODE_SMELL</type>
<severity>BLOCKER</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -2826,7 +2811,6 @@ foo(++i, ++i);&lt;/code&gt;&lt;/pre&gt;
<name>Shadow Function</name>
<description>&lt;h3&gt;Cppcheck&lt;/h3&gt;&lt;p&gt;Local variable f shadows outer function&lt;/p&gt;
</description>
<type>CODE_SMELL</type>
<severity>MINOR</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -3123,7 +3107,6 @@ foo(++i, ++i);&lt;/code&gt;&lt;/pre&gt;
<name>Throw In Noexcept Function</name>
<description>&lt;h3&gt;Cppcheck&lt;/h3&gt;&lt;p&gt;Exception thrown in function declared not to throw exceptions.&lt;/p&gt;
</description>
<type>BUG</type>
<severity>BLOCKER</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -3166,7 +3149,6 @@ foo(++i, ++i);&lt;/code&gt;&lt;/pre&gt;
<name>Unsafe allocation</name>
<description>&lt;h3&gt;Cppcheck&lt;/h3&gt;&lt;p&gt;Unsafe allocation. If funcName() throws, memory could be leaked. Use make_shared&lt;int&gt;() instead.&lt;/p&gt;
</description>
<type>CODE_SMELL</type>
<severity>CRITICAL</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
<description>&lt;p&gt;&lt;strong&gt;Class, Structure:&lt;/strong&gt; number of attributes in the class, including the inherited ones and generated ones backing auto properties; however, the attributes of its nested and anonymous classes are not included.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Namespace:&lt;/strong&gt; number of attributes in the namespace; however, attributes of its subnamespaces are not included.&lt;/p&gt;
</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -652,15 +651,13 @@
<key>MET_CA</key>
<name>Clone Age (CA) Metric Threshold Violation</name>
<description>&lt;b&gt;Clone class/clone instance:&lt;/b&gt; number of previously analyzed revisions in which the clone class/clone instance was present + 1.</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
<rule>
<key>MET_CC</key>
<name>Clone Coverage (CC) Metric Threshold Violation</name>
<description>&lt;b&gt;Method/Interface/Enum/class/Structure/Namespace:&lt;/b&gt; ratio of code covered by code duplications in the source code element to the size of the source code element, expressed in terms of the number of syntactic entities (statements, expressions, etc.).&lt;br&gt;&lt;b&gt;Component:&lt;/b&gt; ratio of code covered by code duplications in the component to the size of the component, expressed in terms of the number of syntactic entities (statements, expressions, etc.).</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand All @@ -682,7 +679,6 @@
<key>MET_CE</key>
<name>Clone Embeddedness (CE) Metric Threshold Violation</name>
<description>&lt;b&gt;Clone instance:&lt;/b&gt; sum of incoming and outgoing references (function calls, variable references, type references; different references to the same entity are counted only once) in the code fragment corresponding to the clone instance, weighted with the number of directory changes between the referenced code fragments.&lt;br&gt;&lt;b&gt;Clone class:&lt;/b&gt; sum of CE of the clone instances of the clone class + 1.</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand All @@ -704,7 +700,6 @@
<key>MET_CI</key>
<name>Clone Instances (CI) Metric Threshold Violation</name>
<description>&lt;b&gt;Method/class/Namespace:&lt;/b&gt; number of clone instances in the source code element.&lt;br&gt;&lt;b&gt;Component:&lt;/b&gt; number of clone instances in the component.&lt;br&gt;&lt;b&gt;Clone class:&lt;/b&gt; number of clone instances in the clone class.</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -740,7 +735,6 @@
<key>MET_CV</key>
<name>Clone Variability (CV) Metric Threshold Violation</name>
<description>&lt;b&gt;Clone instance:&lt;/b&gt; instability of the clone instance since it appeared. It is computed as the ratio of the number of previously analyzed revisions when the instance had been changed to its age (CA).&lt;br&gt;&lt;b&gt;Clone class:&lt;/b&gt; instability of the clone class since it appeared. It is computed as the ratio of the number of previously analyzed revisions when its contained instances were moved, deleted, or added, to its age (CA), plus the average CV of its clone instances.</description>
<type>BUG</type>
<severity>INFO</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -786,7 +780,7 @@
<key>AEC</key>
<name>Avoid excessive complexity</name>
<description>&lt;h3&gt;FxCop&lt;/h3&gt;Method implementations that are exceedingly complex increase the challenge of understanding and maintaining code.</description>
<type>BUG</type>
<type>CODE_SMELL</type>
<severity>MINOR</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -1851,7 +1845,7 @@ You may safely use most of the state on a managed System.Thread object, includin
<key>MEWF</key>
<name>Mark enums with FlagsAttribute</name>
<description>&lt;h3&gt;FxCop&lt;/h3&gt;The enumeration appears to be made up of combinable flags. If this true, apply the Flags attribute to the enumeration.</description>
<type>BUG</type>
<type>CODE_SMELL</type>
<severity>MINOR</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down Expand Up @@ -2323,7 +2317,7 @@ You may safely use most of the state on a managed System.Thread object, includin
<key>SA</key>
<name>Secure asserts</name>
<description>&lt;h3&gt;FxCop&lt;/h3&gt;Asserting a security permission without performing any security checks can leave an exploitable security weakness in your code. A security stack walk stops when a security permission is asserted. If you assert a permission without performing any checks on the caller, the caller might be able to indirectly execute code using your permissions. Asserts without security checks are only permissible when you are certain that the assert cannot be used in a harmful fashion, namely, if the code you call is harmless, or users have no way to pass arbitrary information to code that you call.</description>
<type>BUG</type>
<type>VULNERABILITY</type>
<severity>BLOCKER</severity>
<tag>sourcemeter</tag>
</rule>
Expand Down
Loading

0 comments on commit 95c18b1

Please sign in to comment.