Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Code Analysis #408

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 44 additions & 32 deletions static_code_analysis.txt
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
Run started:2024-05-13 15:58:39.077701
Run started:2024-10-22 16:18:16.010383

Test results:
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Severity: Low Confidence: High
CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b101_assert_used.html
Location: ./ctgan/__main__.py:88:8
87 if args.sample_condition_column is not None:
88 assert args.sample_condition_column_value is not None
89
Location: ./ctgan/__main__.py:122:8
121 if args.sample_condition_column is not None:
122 assert args.sample_condition_column_value is not None
123

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Severity: Low Confidence: High
CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b101_assert_used.html
Location: ./ctgan/data.py:53:12
52 else:
53 assert item[0] == 'D'
54 discrete.append(idx)
Location: ./ctgan/data.py:48:12
47 else:
48 assert item[0] == 'D'
49 discrete.append(idx)

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Severity: Low Confidence: High
CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b101_assert_used.html
Location: ./ctgan/data.py:74:16
73 else:
74 assert idx in discrete
75 row.append(column_info[idx].index(col))
Location: ./ctgan/data.py:69:16
68 else:
69 assert idx in discrete
70 row.append(column_info[idx].index(col))

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Severity: Low Confidence: High
CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b101_assert_used.html
Location: ./ctgan/data.py:91:20
90 else:
91 assert idx in meta['discrete_columns']
92 print(meta['column_info'][idx][int(col)], end=' ', file=f)
Location: ./ctgan/data.py:85:20
84 else:
85 assert idx in meta['discrete_columns']
86 print(meta['column_info'][idx][int(col)], end=' ', file=f)

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Severity: Low Confidence: High
CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b101_assert_used.html
Location: ./ctgan/data_sampler.py:41:8
40 st += sum([span_info.dim for span_info in column_info])
41 assert st == data.shape[1]
42
Location: ./ctgan/data_sampler.py:40:8
39 st += sum([span_info.dim for span_info in column_info])
40 assert st == data.shape[1]
41

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Severity: Low Confidence: High
CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b101_assert_used.html
Location: ./ctgan/synthesizers/ctgan.py:56:8
55 """Apply the Discriminator to the `input_`."""
56 assert input_.size()[0] % self.pac == 0
57 return self.seq(input_.view(-1, self.pacdim))
Location: ./ctgan/synthesizers/ctgan.py:59:8
58 """Apply the Discriminator to the `input_`."""
59 assert input_.size()[0] % self.pac == 0
60 return self.seq(input_.view(-1, self.pacdim))

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Severity: Low Confidence: High
CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b101_assert_used.html
Location: ./ctgan/synthesizers/ctgan.py:148:8
147
148 assert batch_size % 2 == 0
149
Location: ./ctgan/synthesizers/ctgan.py:163:8
162 ):
163 assert batch_size % 2 == 0
164

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Expand All @@ -80,22 +80,34 @@ Test results:
100 assert st == recon_x.size()[1]
101 KLD = -0.5 * torch.sum(1 + logvar - mu**2 - logvar.exp())

--------------------------------------------------
>> Issue: [B105:hardcoded_password_string] Possible hardcoded password: '# History

'
Severity: Low Confidence: Medium
CWE: CWE-259 (https://cwe.mitre.org/data/definitions/259.html)
More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b105_hardcoded_password_string.html
Location: ./scripts/release_notes_generator.py:134:12
133
134 token = '# History\n\n'
135 split_index = history.find(token) + len(token) + 1

--------------------------------------------------

Code scanned:
Total lines of code: 1342
Total lines of code: 1508
Total lines skipped (#nosec): 0
Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
Total issues (by severity):
Undefined: 0
Low: 8
Low: 9
Medium: 0
High: 0
Total issues (by confidence):
Undefined: 0
Low: 0
Medium: 0
Medium: 1
High: 8
Files skipped (0):
Loading