File tree Expand file tree Collapse file tree
templates/scanpipe/includes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1229,6 +1229,11 @@ def dependency_count(self):
12291229 """Return the number of dependencies related to this project."""
12301230 return self .discovereddependencies .count ()
12311231
1232+ @cached_property
1233+ def license_detections_count (self ):
1234+ """Return the number of license detections in this project."""
1235+ return self .discoveredlicenses .count ()
1236+
12321237 @cached_property
12331238 def message_count (self ):
12341239 """Return the number of messages related to this project."""
@@ -3477,7 +3482,7 @@ def as_spdx(self):
34773482class DiscoveredLicenseQuerySet (ProjectRelatedQuerySet ):
34783483 def order_by_count_and_expression (self ):
34793484 """Order by detection count and license expression (identifer) fields."""
3480- return self .order_by ("detection_count" , "identifier" )
3485+ return self .order_by ("- detection_count" , "identifier" )
34813486
34823487
34833488class AbstractLicenseDetection (models .Model ):
Original file line number Diff line number Diff line change 4040 </ p >
4141 </ div >
4242 </ div >
43+ < div class ="level-item has-text-centered ">
44+ < div >
45+ < p class ="heading "> License Detections</ p >
46+ < p class ="{{ title_class }} is-flex is-align-items-center is-justify-content-center ">
47+ {% if project.license_detections_count %}
48+ < a href ="{% url 'project_licenses' project.slug %} ">
49+ {{ project.license_detections_count|intcomma }}
50+ </ a >
51+ {% else %}
52+ < span > 0</ span >
53+ {% endif %}
54+ </ p >
55+ </ div >
56+ </ div >
4357 < div class ="level-item has-text-centered ">
4458 < div >
4559 < p class ="heading "> Resources</ p >
You can’t perform that action at this time.
0 commit comments