You've already forked Openness-Score
mirror of
https://github.com/Dasharo/Openness-Score.git
synced 2026-03-06 14:54:49 -08:00
4de394b7ac
Signed-off-by: Pawel Langowski <pawel.langowski@3mdeb.com>
2.3 KiB
2.3 KiB
Dasharo Openness Score design
Dasharo Openness Score is designed following a few patterns and design rules.
Dasharo Openness Score general rules
-
The utility should not leave any intermediate files during the firmware image processing.
-
The utility should produce a markdown report and two pie charts:
- First pie chart should incudle the overall share percentage of all 4 groups: closed-source, open-source, empty and data
- Second pie chart should incudle the overall share percentage of total closed-source and open-source code only
- Markdown report should print general image statistics and any additional statistic per region or firmware integral part (firmware image type dependent) includign the category the component has been classified
- General image statistic at minimum are: image size, open-source size, closed-source size, data size and empty size
-
The utility must be sa precise as possible to avoid falsified results.
Dasharo Openness Score module design rules
Each class representing a firmware image (or its integral part):
- Must calculate the 4 basic metrics (empty, data, closed-source and open-source) on the class instance creation.
- Should have a string method
__str__which returns a set of 4 basic metrics and general attributes of the entity - Should have a length method
__len__which returns the size of the firmware image (or its integral part) - Must contain attributes for the basic metrics using the following names:
self.open_code_size,self.closed_code_size,self.data_sizeandself.empty_size - Must implement
export_markdownmethod that will produce a markdown report of the firmware image (or its integral part) statistics - Must implement
_calculate_metricsmethod which will perform the image component classification and do the calculations - Should implement a parse method which will perform the extraction of the image components and its attributes
- Must call the parse method and
_calculate_metricsinside the class'__init__method - Must implement
export_chartsmethod to generate pie charts (only for classes representing the whole firmware image) - Must assume a component as closed-source if unable to classify to any category.