Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def end_application(self, application):

with open_source_file(_file.get_path()) as f:

logging.debug('current file (%s) =[ %s ] ' % (CobolFileType, _file.get_path()))
#logging.info('current file (%s) =[ %s ] ' % (CobolFileType, _file.get_path()))

begin_line = 0
current_line = 0
Expand Down Expand Up @@ -138,11 +138,11 @@ def end_application(self, application):
user_code_violations.append(violation)

if (number_of_telon_LOC_in_current_file != 0):
logging.debug('Number of TELON LOC in current file [%s]: %s on a total of %s LOC' % (_file.get_path(), number_of_telon_LOC_in_current_file, current_line))
logging.info('Number of TELON LOC in current file [%s]: %s on a total of %s LOC' % (_file.get_path(), number_of_telon_LOC_in_current_file, current_line))
total_LOC += current_line
telon_LOC += number_of_telon_LOC_in_current_file
else:
logging.debug('File [%s] does not contain any Telon code, file LOC = %s' % (_file.get_path(), current_line))
logging.info('File [%s] does not contain any Telon code, file LOC = %s' % (_file.get_path(), current_line))
total_LOC += current_line

if is_telon:
Expand All @@ -158,7 +158,11 @@ def end_application(self, application):

# et hop !

logging.info('Found %s TELON programs out of %s programs and %s copybooks' % (number_of_telon_programs, number_of_programs, number_of_cobol_copybooks))
logging.info('Kept %s violation bookmarks out of %s' % (number_of_kept_violations, number_of_violations))
logging.info('Number of TELON LOC : %s on a total of %s LOC, which means %s percent of generated LOC' % (telon_LOC, total_LOC, round(telon_LOC*100/total_LOC,2)))
logging.info("Done filtering violations")

if (total_LOC > 0):
logging.info('Found %s TELON programs out of %s programs and %s copybooks' % (number_of_telon_programs, number_of_programs, number_of_cobol_copybooks))
logging.info('Kept %s violation bookmarks out of %s' % (number_of_kept_violations, number_of_violations))
logging.info('Number of TELON LOC : %s on a total of %s LOC, which means %s percent of generated LOC' % (telon_LOC, total_LOC, round(telon_LOC*100/total_LOC,2)))
logging.info("Done filtering violations")
else:
logging.info('*** No Cobol files analyzed, so no Telon code to filter')