quality module

bzr revid: mra@tinyerp.com-20090112133853-ay2ipw8iy4y31btl
This commit is contained in:
mra (Open ERP) 2009-01-12 19:08:53 +05:30
parent 4bcd33f3b6
commit e9e5969a5c
4 changed files with 17 additions and 14 deletions

View File

@ -67,6 +67,7 @@ class quality_test(base_module_quality.abstract_quality_check):
break
n += 1
leftchar = -1
# print res
while res[leftchar:leftchar+1] != ' ' and leftchar-1 <= 0:
leftchar -= 1
rightchar = -10
@ -80,6 +81,7 @@ class quality_test(base_module_quality.abstract_quality_check):
score += 0
#self.result += file + ": "+_("Unable to parse the result. Check the details.")+"\n"
dict[file] = [file, _("Unable to parse the result. Check the details.")]
# self.result_details += res.replace('''<div''', '''<div class="wikiwidget readonlyfield"''')
self.result_details += res.replace('''<div''', '''<div class="wikiwidget readonlyfield"''')
self.result_details += '</body></html>'
average_score = n and score / n or score

View File

@ -1,11 +1,11 @@
# lint Python modules using external checkers.
#
#
# This is the main checker controlling the other ones and the reports
# generation. It is itself both a raw checker and an astng checker in order
# to:
# * handle message activation / deactivation at the module level
# * handle some basic but necessary stats'data (number of classes, methods...)
#
#
[MASTER]
# Specify a configuration file.
@ -98,7 +98,7 @@ comment=no
# * undefined variables
# * redefinition of variable from builtins or from an outer scope
# * use of variable before assigment
#
#
[VARIABLES]
# Tells wether we should check for unused import in __init__ files.
@ -113,7 +113,7 @@ additional-builtins=
# try to find bugs in the code using type inference
#
#
[TYPECHECK]
# Tells wether missing members accessed in mixin class should be ignored. A
@ -138,7 +138,7 @@ acquired-members=REQUEST,acl_users,aq_parent
# * dangerous default values as arguments
# * redefinition of function / method / class
# * uses of the global statement
#
#
[BASIC]
# Required attributes for module, separated by a comma
@ -191,7 +191,7 @@ bad-functions=map,filter,apply,input
# * relative / wildcard imports
# * cyclic imports
# * uses of deprecated modules
#
#
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
@ -217,7 +217,7 @@ int-import-graph=
# * attributes not defined in the __init__ method
# * supported interfaces implementation
# * unreachable code
#
#
[CLASSES]
# List of interface methods to ignore, separated by a comma. This is used for
@ -231,7 +231,7 @@ defining-attr-methods=__init__,__new__,setUp
# checks for sign of poor/misdesign:
# * number of methods, attributes, local variables...
# * size, complexity of functions, methods
#
#
[DESIGN]
# Maximum number of arguments for function / method
@ -267,7 +267,7 @@ max-public-methods=20
# * strict indentation
# * line length
# * use of <> instead of !=
#
#
[FORMAT]
# Maximum number of characters on a single line.
@ -284,7 +284,7 @@ indent-string=' '
# checks for similarities and duplicated code. This computation may be
# memory / CPU intensive, so you should disable it if you experiments some
# problems.
#
#
[SIMILARITIES]
# Minimum lines number of a similarity.
@ -300,7 +300,7 @@ ignore-docstrings=yes
# checks for:
# * warning notes in the code like FIXME, XXX
# * PEP 263: source code with non ascii character but no encoding declaration
#
#
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.

View File

@ -110,9 +110,11 @@ This test checks the speed of the module. Note that at least 5 demo data is need
return ""
def get_result_details(self, dict):
header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')])
# header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')])
header = ('! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')])
# todo ...ronvert result come from format table to html format will display in table format
if not self.error:
return self.format_table(header, data_list=dict)
return '<pre>' + self.format_table(header, data_list=dict) + '</pre>'
return ""
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -60,7 +60,6 @@ class create_quality_check(wizard.interface):
def _create_quality_check(self, cr, uid, data, context={}):
pool = pooler.get_pool(cr.dbname)
print data, context
objs = []
for id in data['ids']:
module_data = pool.get('ir.module.module').browse(cr, uid, id)