DataViews/CodeMetrics.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2602
affc66a603c7
parent 2986
cd4e2cab7eb2
child 3058
0a02c433f52d
--- a/DataViews/CodeMetrics.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/DataViews/CodeMetrics.py	Fri Oct 18 23:00:41 2013 +0200
@@ -41,7 +41,7 @@
         """
         Constructor
         
-        @param **kw list of key, value pairs
+        @keyparam **kw list of key, value pairs
         """
         self.__dict__.update(kw)
 
@@ -114,9 +114,12 @@
         """
         Constructor
         """
-        self.identifiers = []  # list of identifiers in order of appearance
-        self.active = [('TOTAL ', -1, 0)]   # stack of active identifiers and indent levels
-        self.counters = {}  # counters per identifier
+        self.identifiers = []
+        # list of identifiers in order of appearance
+        self.active = [('TOTAL ', -1, 0)]
+        # stack of active identifiers and indent levels
+        self.counters = {}
+        # counters per identifier
         self.indent_level = 0
 
     def indent(self, tok):
@@ -132,6 +135,7 @@
         Public method used to decrement the indentation level.
         
         @param tok the token to be processed (Token)
+        @exception ValueError raised to indicate an invalid indentation level
         """
         self.indent_level -= 1
         if self.indent_level < 0:
@@ -258,17 +262,18 @@
     summarize(total, 'bytes', len(text))
     summarize(total, 'comments', stats.getCounter('TOTAL ', 'comments'))
     summarize(total, 'empty lines', stats.getCounter('TOTAL ', 'empty'))
-    summarize(total, 'non-commentary lines', stats.getCounter('TOTAL ', 'nloc'))
+    summarize(total, 'non-commentary lines',
+              stats.getCounter('TOTAL ', 'nloc'))
 
     return stats
     
 
 def main():
     """
-    Modules main function used when called as a script.
+    Module main function used when called as a script.
     
-    This function simply loops over all files given on the commandline
-    and collects the individual and overall source code statistics.
+    Loop over all files given on the command line and collect the individual
+    and overall source code statistics.
     """
     import sys
     

eric ide

mercurial