Skip to content

Commit 744b230

Browse files
committed
todo
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent a32e5f6 commit 744b230

File tree

9 files changed

+34
-7
lines changed

9 files changed

+34
-7
lines changed

cyclonedx/model/__init__.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def __lt__(self, other: object) -> bool:
148148
return NotImplemented
149149

150150
def __hash__(self) -> int:
151+
# TODO
151152
return hash((self.flow, self.classification))
152153

153154
def __repr__(self) -> str:
@@ -251,6 +252,7 @@ def __lt__(self, other: Any) -> bool:
251252
return NotImplemented
252253

253254
def __hash__(self) -> int:
255+
# TODO
254256
return hash((self.content, self.content_type, self.encoding))
255257

256258
def __repr__(self) -> str:
@@ -530,6 +532,7 @@ def __lt__(self, other: Any) -> bool:
530532
return NotImplemented
531533

532534
def __hash__(self) -> int:
535+
# TODO
533536
return hash((self.alg, self.content))
534537

535538
def __repr__(self) -> str:
@@ -733,7 +736,7 @@ def __init__(self, uri: str) -> None:
733736

734737
def __eq__(self, other: Any) -> bool:
735738
if isinstance(other, XsUri):
736-
return hash(other) == hash(self)
739+
return self._uri == other._uri
737740
return False
738741

739742
def __lt__(self, other: Any) -> bool:
@@ -907,6 +910,7 @@ def __lt__(self, other: Any) -> bool:
907910
return NotImplemented
908911

909912
def __hash__(self) -> int:
913+
# TODO
910914
return hash((
911915
self._type, self._url, self._comment,
912916
tuple(sorted(self._hashes, key=hash))
@@ -984,6 +988,7 @@ def __lt__(self, other: Any) -> bool:
984988
return NotImplemented
985989

986990
def __hash__(self) -> int:
991+
# TODO
987992
return hash((self.name, self.value))
988993

989994
def __repr__(self) -> str:
@@ -1075,6 +1080,7 @@ def __lt__(self, other: Any) -> bool:
10751080
return NotImplemented
10761081

10771082
def __hash__(self) -> int:
1083+
# TODO
10781084
return hash((self.content, self.content_type, self.encoding))
10791085

10801086
def __repr__(self) -> str:
@@ -1159,6 +1165,7 @@ def __lt__(self, other: Any) -> bool:
11591165
return NotImplemented
11601166

11611167
def __hash__(self) -> int:
1168+
# TODO
11621169
return hash((self.text, self.locale))
11631170

11641171
def __repr__(self) -> str:
@@ -1249,6 +1256,7 @@ def __lt__(self, other: Any) -> bool:
12491256
return NotImplemented
12501257

12511258
def __hash__(self) -> int:
1259+
# TODO
12521260
return hash((self.timestamp, self.name, self.email))
12531261

12541262
def __repr__(self) -> str:
@@ -1287,16 +1295,16 @@ def text(self, text: str) -> None:
12871295

12881296
def __eq__(self, other: object) -> bool:
12891297
if isinstance(other, Copyright):
1290-
return hash(other) == hash(self)
1298+
return self._text == other._text
12911299
return False
12921300

12931301
def __lt__(self, other: Any) -> bool:
12941302
if isinstance(other, Copyright):
1295-
return self.text < other.text
1303+
return self._text < other._text
12961304
return NotImplemented
12971305

12981306
def __hash__(self) -> int:
1299-
return hash(self.text)
1307+
return hash(self._text)
13001308

13011309
def __repr__(self) -> str:
13021310
return f'<Copyright text={self.text}>'

cyclonedx/model/component.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ def __eq__(self, other: object) -> bool:
763763
return False
764764

765765
def __hash__(self) -> int:
766+
# TODO
766767
return hash((
767768
tuple(self.ancestors), tuple(self.descendants), tuple(self.variants), tuple(self.commits),
768769
tuple(self.patches), self.notes
@@ -908,6 +909,7 @@ def __eq__(self, other: object) -> bool:
908909
return False
909910

910911
def __hash__(self) -> int:
912+
# TODO
911913
return hash((self.tag_id, self.name, self.version, self.tag_version, self.patch, self.text, self.url))
912914

913915
def __repr__(self) -> str:
@@ -955,7 +957,7 @@ def deserialize(cls, o: Any) -> 'OmniborId':
955957

956958
def __eq__(self, other: Any) -> bool:
957959
if isinstance(other, OmniborId):
958-
return hash(other) == hash(self)
960+
return self._id == other._id
959961
return False
960962

961963
def __lt__(self, other: Any) -> bool:
@@ -1014,7 +1016,7 @@ def deserialize(cls, o: Any) -> 'Swhid':
10141016

10151017
def __eq__(self, other: Any) -> bool:
10161018
if isinstance(other, Swhid):
1017-
return hash(other) == hash(self)
1019+
return self._id == other._id
10181020
return False
10191021

10201022
def __lt__(self, other: Any) -> bool:

cyclonedx/model/contact.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ def __lt__(self, other: Any) -> bool:
275275
return NotImplemented
276276

277277
def __hash__(self) -> int:
278+
# TODO
278279
return hash((self.name, self.phone, self.email))
279280

280281
def __repr__(self) -> str:
@@ -384,6 +385,7 @@ def __lt__(self, other: Any) -> bool:
384385
return NotImplemented
385386

386387
def __hash__(self) -> int:
388+
# TODO
387389
return hash((self.name, tuple(self.urls), tuple(self.contacts)))
388390

389391
def __repr__(self) -> str:

cyclonedx/model/crypto.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ def __eq__(self, other: object) -> bool:
501501
return False
502502

503503
def __hash__(self) -> int:
504+
# TODO
504505
return hash((self.primitive, self._parameter_set_identifier, self.curve, self.execution_environment,
505506
self.implementation_platform, tuple(self.certification_levels), self.mode, self.padding,
506507
tuple(self.crypto_functions), self.classical_security_level, self.nist_quantum_security_level,))
@@ -673,6 +674,7 @@ def __eq__(self, other: object) -> bool:
673674
return False
674675

675676
def __hash__(self) -> int:
677+
# TODO
676678
return hash((self.subject_name, self.issuer_name, self.not_valid_before, self.not_valid_after,
677679
self.certificate_format, self.certificate_extension))
678680

@@ -796,6 +798,7 @@ def __eq__(self, other: object) -> bool:
796798
return False
797799

798800
def __hash__(self) -> int:
801+
# TODO
799802
return hash((self.mechanism, self.algorithm_ref))
800803

801804
def __repr__(self) -> str:
@@ -1035,6 +1038,7 @@ def __eq__(self, other: object) -> bool:
10351038
return False
10361039

10371040
def __hash__(self) -> int:
1041+
# TODO
10381042
return hash((self.type, self.id, self.state, self.algorithm_ref, self.creation_date, self.activation_date,
10391043
self.update_date, self.expiration_date, self.value, self.size, self.format, self.secured_by))
10401044

@@ -1152,6 +1156,7 @@ def __lt__(self, other: Any) -> bool:
11521156
return NotImplemented
11531157

11541158
def __hash__(self) -> int:
1159+
# TODO
11551160
return hash((self.name, tuple(self.algorithms), tuple(self.identifiers)))
11561161

11571162
def __repr__(self) -> str:
@@ -1284,6 +1289,7 @@ def __eq__(self, other: object) -> bool:
12841289
return False
12851290

12861291
def __hash__(self) -> int:
1292+
# TODO
12871293
return hash((tuple(self.encr), tuple(self.prf), tuple(self.integ), tuple(self.ke), self.esn, tuple(self.auth)))
12881294

12891295
def __repr__(self) -> str:
@@ -1383,6 +1389,7 @@ def __eq__(self, other: object) -> bool:
13831389
return False
13841390

13851391
def __hash__(self) -> int:
1392+
# TODO
13861393
return hash((self.type, self.version, tuple(self.cipher_suites), self.ikev2_transform_types))
13871394

13881395
def __repr__(self) -> str:
@@ -1539,6 +1546,7 @@ def __lt__(self, other: Any) -> bool:
15391546
return NotImplemented
15401547

15411548
def __hash__(self) -> int:
1549+
# TODO
15421550
return hash((self.asset_type, self.algorithm_properties, self.certificate_properties,
15431551
self.related_crypto_material_properties, self.protocol_properties, self.oid))
15441552

cyclonedx/model/dependency.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def __lt__(self, other: Any) -> bool:
9999
return NotImplemented
100100

101101
def __hash__(self) -> int:
102+
# TODO
102103
return hash((self.ref, tuple(self.dependencies)))
103104

104105
def __repr__(self) -> str:

cyclonedx/model/issue.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def __lt__(self, other: Any) -> bool:
105105
return NotImplemented
106106

107107
def __hash__(self) -> int:
108+
# TODO
108109
return hash((self.name, self.url))
109110

110111
def __repr__(self) -> str:
@@ -246,6 +247,7 @@ def __lt__(self, other: Any) -> bool:
246247
return NotImplemented
247248

248249
def __hash__(self) -> int:
250+
# TODO
249251
return hash((
250252
self.type, self.id, self.name, self.description, self.source, tuple(self.references)
251253
))

cyclonedx/model/license.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ def __lt__(self, other: Any) -> bool:
232232
return NotImplemented
233233

234234
def __hash__(self) -> int:
235+
# TODO
235236
return hash((self._id, self._name, self._text, self._url, self._acknowledgement))
236237

237238
def __repr__(self) -> str:
@@ -309,6 +310,7 @@ def acknowledgement(self, acknowledgement: Optional[LicenseAcknowledgement]) ->
309310
self._acknowledgement = acknowledgement
310311

311312
def __hash__(self) -> int:
313+
# TODO
312314
return hash((self._value, self._acknowledgement))
313315

314316
def __eq__(self, other: object) -> bool:

cyclonedx/model/lifecycle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __hash__(self) -> int:
8383

8484
def __eq__(self, other: object) -> bool:
8585
if isinstance(other, PredefinedLifecycle):
86-
return hash(other) == hash(self)
86+
return self._phase == other._phase
8787
return False
8888

8989
def __lt__(self, other: Any) -> bool:
@@ -143,6 +143,7 @@ def description(self, description: Optional[str]) -> None:
143143
self._description = description
144144

145145
def __hash__(self) -> int:
146+
# TODO
146147
return hash((self._name, self._description))
147148

148149
def __eq__(self, other: object) -> bool:

cyclonedx/model/release_note.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def __eq__(self, other: object) -> bool:
239239
return False
240240

241241
def __hash__(self) -> int:
242+
# TODO
242243
return hash((
243244
self.type, self.title, self.featured_image, self.social_image, self.description, self.timestamp,
244245
tuple(self.aliases), tuple(self.tags), tuple(self.resolves), tuple(self.notes), tuple(self.properties)

0 commit comments

Comments
 (0)