Skip to content

Commit

Permalink
statistics.py: declarationSubject statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed (ODSC) committed Sep 22, 2024
1 parent 604eaf9 commit e3b4815
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions libcovebods/tasks/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,3 +508,23 @@ def get_statistics(self):
return {
"count_ownership_or_control_statement_with_at_least_one_interest_beneficial": self.stat,
}


class StatisticDeclarationSubjects(AdditionalCheck):
@staticmethod
def does_apply_to_schema(lib_cove_bods_config, schema_object) -> bool:
return schema_object.is_schema_version_equal_to_or_greater_than("0.4")

def __init__(self, lib_cove_bods_config, schema_object):
super().__init__(lib_cove_bods_config, schema_object)
self._declaration_subjects = {}

def check_statement_first_pass(self, statement):
if ("recordId" in statement and "declarationSubject" in statement and
statement["recordId"] == statement["declarationSubject"]):
self._declaration_subjects[statement["recordId"]] = 1

def get_statistics(self):
return {
"count_declaration_subjects": len(self._declaration_subjects),
}

0 comments on commit e3b4815

Please sign in to comment.