소스 검색

Project documentation updated, few improvements for info and export tools.

avkonst 12 년 전
부모
커밋
d21f05e0b4
4개의 변경된 파일59개의 추가작업 그리고 16개의 파일을 삭제
  1. 10 1
      mainline/doc/limitations.txt
  2. 18 13
      mainline/doc/project.html
  3. 10 0
      mainline/export.py
  4. 21 2
      mainline/info.py

+ 10 - 1
mainline/doc/limitations.txt

@@ -21,7 +21,7 @@
 
 *** Known Limitations ***
 
-1) C/C++ parser does not recognise definition of functions or overloaded operators
+1) C/C++ parser and C# parser do not recognise definition of functions or overloaded operators
    in case of embeded comments after identifier name and before the list of arguments.
 
      This function is not detected by Metrix++: | This function is detected:
@@ -43,3 +43,12 @@
               */                     \          |     #define GET_MAX(a, b) \
              ((a > b) ? a : b)                  |         ((a > b) ? a : b)
 
+2) C# parser does not recognise getters/setters for properties, if there is a comment before a block.
+   These comments are considered to be parts of a define.
+
+     This function is not detected by Metrix++: | This function is detected:
+     -------------------------------------------|-------------------------------------------
+         get /* undesarable comment */          |     get
+         {                                      |     { /* here comment is fine */
+             /* ... */                          |         /* ... */
+         }                                      |     }

+ 18 - 13
mainline/doc/project.html

@@ -114,23 +114,28 @@ along with Metrix++. If not, see <http://www.gnu.org/licenses/>.
                     <ul>
                       <li><span class="normalImportance">C/C++</span> parser
                         recognises definition of namespaces, definition of
-                        classes/structs (including enclosed in functions) and
-                        definition of functions/operators </li>
+                        classes/structs (including enclosed in functions),
+                        templates and definition of functions/operators</li>
+                      <li><span class="normalImportance">C#</span> parser
+                        recognises definition of namespaces, definition of
+                        classes/structs (including enclosed in functions),
+                        interfaces, generics, definition of
+                      functions/operators</li>
                     </ul>
                   </li>
                   <li><h4>Metrics</h4>
                     <ul>
                       <li><span class="normalImportance">cyclomatic
                         complexity</span> (by McCabe) per function <span
-                        class="lowImportance">[supports C/C++
-                      language]</span></li>
-                      <li><span class="normalImportance">mismatched
-                        brackets</span> '{}'' per file <span
-                        class="lowImportance">[supports C/C++
-                      language]</span></li>
+                        class="lowImportance">[supports C/C++, C#
+                        languages]</span></li>
+                      <li><span class="normalImportance">processing
+                        errors</span> per file <span
+                        class="lowImportance">[supports any file
+                      type]</span></li>
                       <li><span class="normalImportance">processing time</span>
-                        per file <span class="lowImportance">[supports any
-                        file]</span></li>
+                        per file <span class="lowImportance">[supports any file
+                        type]</span></li>
                     </ul>
                   </li>
                   <li><h4>Analysis tools</h4>
@@ -150,6 +155,9 @@ along with Metrix++. If not, see <http://www.gnu.org/licenses/>.
                         which are configurable (output is plain text with
                         metadata compatible with gcc compiler warning
                       messages)</li>
+                      <li><span class="normalImportance">info.py</span> - a
+                        tool to show file metadata, such as properties,
+                        namespaces and fields recorded</li>
                     </ul>
                   </li>
                 </ul>
@@ -262,9 +270,6 @@ along with Metrix++. If not, see <http://www.gnu.org/licenses/>.
             &lt;<span class="normalImportance">std.code.complexity</span>&gt;
                 &lt;cyclomatic max="2" total="14.0" avg="0.168674698795" min="0" /&gt;
             &lt;/<span class="normalImportance">std.code.complexity</span>&gt;
-            &lt;<span class="normalImportance">std.code.cpp</span>&gt;
-                &lt;files max="1" total="4.0" avg="1.0" min="1" /&gt;
-            &lt;/<span class="normalImportance">std.code.cpp</span>&gt;
         &lt;/aggregated-data&gt;
     &lt;/data&gt;
 &lt;/export&gt;</span>

+ 10 - 0
mainline/export.py

@@ -64,6 +64,16 @@ def main():
     loader = core.db.loader.Loader()
     loader.open_database(db_plugin.dbfile)
     
+    # Check for versions consistency
+    for each in loader.iterate_properties():
+        if db_plugin.dbfile_prev != None:
+            prev = loader_prev.get_property(each.name)
+            if prev != each.value:
+                logging.warn("Previous data has got different metadata:")
+                logging.warn(" - identification of change trends can be not reliable")
+                logging.warn(" - use 'info' tool to get more details")
+                break
+    
     paths = None
     if len(args) == 0:
         paths = [""]

+ 21 - 2
mainline/info.py

@@ -48,15 +48,34 @@ def main():
     if db_plugin.dbfile_prev != None:
         loader_prev = core.db.loader.Loader()
         loader_prev.open_database(db_plugin.dbfile_prev)
-    print "Info data:"
+
+    print "Properties:"
     for each in loader.iterate_properties():
         prev_value_str = ""
         if loader_prev != None:
             prev = loader_prev.get_property(each.name)
             if prev != each.value:
-                prev_value_str = " [previous value: " + loader_prev.get_property(each.name) + "]"
+                prev_value_str = " [previous file: " + loader_prev.get_property(each.name) + "]"
                 print "(!)",
         print "\t" + each.name + "\t=>\t" + each.value + prev_value_str
+
+    print "Namespaces:"
+    for each in loader.iterate_namespace_names():
+        prev_value_str = ""
+        if loader_prev != None:
+            prev = loader_prev.get_namespace(each)
+            if prev == None:
+                prev_value_str = " [previous file: missed]"
+                print "(!)",
+        print "\t" + each + prev_value_str
+        for field in loader.get_namespace(each).iterate_field_names():
+            prev_value_str = ""
+            if loader_prev != None:
+                prev = loader_prev.get_namespace(each).get_field_packager(field)
+                if prev == None:
+                    prev_value_str = " [previous file: missed]"
+                    print "(!)",
+            print "\t\t- " + field + prev_value_str
         
     return exit_code