Skip to content

Commit 6bc9137

Browse files
committed
Merge main and fix conflicts
Signed-off-by: tdruez <[email protected]>
2 parents bfa3200 + 67fc2c3 commit 6bc9137

File tree

14 files changed

+352
-113
lines changed

14 files changed

+352
-113
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ v35.2.0 (unreleased)
1818
``policies.yml`` file.
1919
https://github.com/aboutcode-org/scancode.io/issues/1348
2020

21+
- Enhance the dependency tree view in a more dynamic rendering.
22+
Vulnerabilities and compliance alert are displayed along the dependency entries.
23+
https://github.com/aboutcode-org/scancode.io/pull/1742
24+
2125
v35.1.0 (2025-07-02)
2226
--------------------
2327

Lines changed: 7 additions & 0 deletions
Loading
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
.tree{
2+
--spacing : 1.5rem;
3+
--radius : 10px;
4+
}
5+
6+
.tree li{
7+
display : block;
8+
position : relative;
9+
padding-left : calc(2 * var(--spacing) - var(--radius) - 2px);
10+
}
11+
12+
.tree ul{
13+
margin-left : calc(var(--radius) - var(--spacing));
14+
padding-left : 0;
15+
}
16+
17+
.tree ul li{
18+
border-left : 2px solid #ddd;
19+
}
20+
21+
.tree ul li:last-child{
22+
border-color : transparent;
23+
}
24+
25+
.tree ul li::before{
26+
content : '';
27+
display : block;
28+
position : absolute;
29+
top : calc(var(--spacing) / -2);
30+
left : -2px;
31+
width : calc(var(--spacing) + 2px);
32+
height : calc(var(--spacing) + 1px);
33+
border : solid #ddd;
34+
border-width : 0 0 2px 2px;
35+
}
36+
37+
.tree summary{
38+
display : block;
39+
cursor : pointer;
40+
}
41+
42+
.tree summary::marker,
43+
.tree summary::-webkit-details-marker{
44+
display : none;
45+
}
46+
47+
.tree summary:focus{
48+
outline : none;
49+
}
50+
51+
.tree summary:focus-visible{
52+
outline : 1px dotted #000;
53+
}
54+
55+
.tree li::after,
56+
.tree summary::before{
57+
content : '';
58+
display : block;
59+
position : absolute;
60+
top : calc(var(--spacing) / 2 - var(--radius));
61+
left : calc(var(--spacing) - var(--radius) - 1px);
62+
width : calc(2 * var(--radius));
63+
height : calc(2 * var(--radius));
64+
border-radius : 50%;
65+
background : #ddd;
66+
}
67+
68+
.tree summary::before{
69+
z-index : 1;
70+
background : #696 url('expand-collapse.svg') 0 0;
71+
}
72+
73+
.tree details[open] > summary::before{
74+
background-position : calc(-2 * var(--radius)) 0;
75+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
about_resource: tree.css
2+
name: css-tree-views
3+
homepage_url: https://iamkate.com/code/tree-views/
4+
description: A tree view (collapsible list) can be created using only html and css, without
5+
the need for JavaScript. Accessibility software will see the tree view as lists nested inside
6+
disclosure widgets, and the standard keyboard interaction is supported automatically.
7+
license_expression: cc0-1.0
8+
licenses:
9+
- key: cc0-1.0
10+
name: cc0-1.0
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Free content on iamkate.com
2+
The web was still young when I first went online in 1998. It felt like a utopian dream of free culture and free knowledge. Anyone could contribute, and within weeks I had learnt html and created my first site, hosted in the 10mb of webspace my isp included as standard.
3+
4+
I’ve watched as the dream has become a nightmare of surveillance and monetisation. Companies such as Google and Facebook offer their services for free to the public because their real products are their advertising networks powered by the personal data of their visitors.
5+
6+
The only concern of these companies and their shareholders is to maximise their income from advertising, regardless of the costs to society. They use dubious schemes to avoid paying tax. They encourage addiction and risk the mental health of their visitors. They threaten democratic institutions.
7+
8+
I have little influence over the wider web, but I can control my small part of it, creating a haven that remains true to the original dream. This page describes my approach to copyright, my promise to protect the privacy of my visitors, and my commitment to transparency.
9+
10+
Copyright
11+
Copyright limits creativity and holds back progress by restricting our rights to build upon the works of others. Copyleft licences attempt to use copyright against itself, but “the master’s tools will never dismantle the master’s house”, as Audre Lorde remarked in a different context.
12+
13+
All content on my site is released under the terms of the Creative Commons CC0 1.0 Universal Legal Code. This means I have waived all copyright and related rights to the extent possible under law, with the intention of dedicating the content to the public domain. You can use and adapt it without attribution.
14+
15+
Privacy
16+
Every site is hosted on a server, which is usually operated by a third party due to the expertise needed to manage servers securely. Most sites are accessed indirectly through the servers of a content delivery network, which protects the original server from attacks that could disable the site.
17+
18+
My site is hosted on Cloudflare Pages. Cloudflare is both the host and the content delivery network, avoiding the need to trust two separate third parties. Cloudflare have a strong commitment to privacy and data protection, and frequently write about developing systems to protect visitor privacy.
19+
20+
Almost every site today includes code that tracks visitors for statistical and advertising purposes. Often the site owner includes code with the deliberate aim of tracking their visitors, but sometimes they just want to include a feature provided by a third party, and that provider includes their own tracking code.
21+
22+
My site doesn’t include any tracking code, and doesn’t load any code from third parties. It doesn’t have a cookie banner because it doesn’t use cookies. Instead of an invasive analytics system, Cloudflare Web Analytics gives me the most important statistics without tracking individual visitors.
23+
24+
Transparency
25+
You probably don’t know me, and shouldn’t have to trust me. Instead, you should be able to check security and privacy claims for yourself. Unfortunately most sites today use a process called code minification, which makes them faster but also makes it harder for other people to understand their code.
26+
27+
The Mozilla Observatory report for my site confirms the presence of various security and privacy features, resulting in a perfect A+ rating. One of these features, the content security policy, prevents browsers from loading code and other resources from third parties.
28+
29+
My site doesn’t need to use code minification in order to load quickly due to its simple design, efficient implementation, and absence of resources loaded from third parties. As a result, other software developers can easily understand how the layout, styling, and interactive features are created.

scanpipe/models.py

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,6 +2568,13 @@ def from_db(cls, db, field_names, values):
25682568

25692569
return new
25702570

2571+
@property
2572+
def has_compliance_issue(self):
2573+
"""Return True if the compliance status is not OK or not set."""
2574+
if not self.compliance_alert or self.compliance_alert == self.Compliance.OK:
2575+
return False
2576+
return True
2577+
25712578
@property
25722579
def license_policy_index(self):
25732580
return self.project.license_policy_index
@@ -3831,12 +3838,23 @@ class DiscoveredDependency(
38313838
38323839
This class manages dependencies with the following considerations:
38333840
3834-
1. A dependency can be associated with a Package via the "for_package" field.
3835-
In this case, it is termed a "Package's dependency". If there is no such
3836-
association, the dependency is considered a "Project's dependency".
3841+
1. A dependency can be associated with a Package via the ``for_package`` field.
3842+
In this case, it is termed a "Package's dependency".
3843+
If there is no such association, the dependency is considered a
3844+
"Project's dependency".
38373845
3838-
2. A dependency can also be linked to a Package through the "resolved_to_package"
3846+
2. A dependency can also be linked to a Package through the ``resolved_to_package``
38393847
field. When this link exists, the dependency is considered "resolved".
3848+
3849+
3. Dependencies can be either direct or transitive:
3850+
- A **direct dependency** is explicitly declared in a package manifest or
3851+
lockfile.
3852+
- A **transitive dependency** is not declared directly, but is required by one
3853+
of the project's direct dependencies.
3854+
3855+
Understanding the distinction between direct and transitive dependencies is
3856+
important for analyzing dependency trees, resolving version conflicts, and
3857+
assessing potential security risks.
38403858
"""
38413859

38423860
# Overrides the `project` field to set the proper `related_name`.
@@ -3989,14 +4007,20 @@ def datafile_path(self):
39894007

39904008
@property
39914009
def is_project_dependency(self):
4010+
"""
4011+
Return True if the dependency is directly associated with the project
4012+
(not tied to a specific package).
4013+
"""
39924014
return not bool(self.for_package_id)
39934015

39944016
@property
3995-
def is_for_package(self):
4017+
def is_package_dependency(self):
4018+
"""Return True if the dependency is explicitly associated with a package."""
39964019
return bool(self.for_package_id)
39974020

39984021
@property
39994022
def is_resolved_to_package(self):
4023+
"""Return True if the dependency is resolved to a package."""
40004024
return bool(self.resolved_to_package_id)
40014025

40024026
@classmethod
@@ -4014,11 +4038,13 @@ def create_from_data(
40144038
Create and returns a DiscoveredDependency for a `project` from the
40154039
`dependency_data`.
40164040
4017-
The `for_package` and `resolved_to_package` FK can be provided as args or
4018-
in the dependency_data providing the `for_package_uid` and
4041+
The `for_package` and `resolved_to_package` FKs can be provided as args,
4042+
or in the `dependency_data` using the `for_package_uid` and
40194043
`resolve_to_package_uid`.
4020-
Note that a dependency without a `for_package` FK is a project dependency and
4021-
a dependency without a `resolve_to_package` is unresolved.
4044+
4045+
Note that a dependency:
4046+
- without a `for_package` FK is a "Project's dependency"
4047+
- without a `resolve_to_package` is "unresolved".
40224048
40234049
If `strip_datafile_path_root` is True, then `create_from_data()` will
40244050
strip the root path segment from the `datafile_path` of

scanpipe/templates/scanpipe/includes/project_list_table.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</a>
4242
<a href="{% url 'project_dependency_tree' project.slug %}">
4343
<span class="icon">
44-
<i class="fa-solid fa-sitemap"></i>
44+
<i class="fa-solid fa-sitemap fa-sm"></i>
4545
</span>
4646
</a>
4747
{% else %}

scanpipe/templates/scanpipe/includes/project_summary_level.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
{{ project.vulnerable_dependency_count|intcomma }}
4545
</a>
4646
{% endif %}
47+
<a href="{% url 'project_dependency_tree' project.slug %}" class="ml-2">
48+
<span class="icon">
49+
<i class="fa-solid fa-sitemap is-size-6"></i>
50+
</span>
51+
</a>
4752
{% else %}
4853
<span class="has-text-grey">0</span>
4954
{% endif %}

0 commit comments

Comments
 (0)