def update_stats(self, file_result):
        """
        Reads the data from a FileResult and updates overall statistics
        :param file_result: A FileResult instance
        """

        for code, count in file_result.violations.items():
            if code not in self.violations:
                self.violations[code] = 0
            self.violations[code] += file_result.violations[code]

            if 'E' in code.upper():
                self.total_errors += file_result.violations[code]
            elif 'W' in code.upper():
                self.total_warnings += file_result.violations[code]
            else:
                self.total_other += file_result.violations[code]
def update_stats ( self , file_result ) : for code , count in file_result . violations . items ( ) : if code not in self . violations : self . violations [ code ] = 0 self . violations [ code ] += file_result . violations [ code ] if 'E' in code . upper ( ) : self . total_errors += file_result . violations [ code ] elif 'W' in code . upper ( ) : self . total_warnings += file_result . violations [ code ] else : self . total_other += file_result . violations [ code ]
Reads the data from a FileResult and updates overall statistics
        :param file_result: A FileResult instance