Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions kotlin/bin/test/com/kheiron/ktbind/NativeBindingsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ abstract class NativeObject : AutoCloseable {
*/
@Suppress("unused")
private val nativePointer: Long = 0
private val testvar123455VariableMVariableMaxLengthVariableMaxLengthaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLength: Long = 0
}

private class TempTest(message: String) : Throwable(message: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ abstract class NativeObject : AutoCloseable {
*/
@Suppress("unused")
private val nativePointer: Long = 0
private val testvar123455VariableMVariableMaxLengthVariableMaxLengthaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLengthVariableMaxLength: Long = 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ LOW RISK

Nitpick: The variable name is excessively long (>180 characters) and impairs readability. Standard naming conventions recommend concise, descriptive names.

}

private class TempTest(message: String) : Throwable(message: String) {
Expand Down
17 changes: 16 additions & 1 deletion python/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,24 @@ def get_name(self, user_id):
return 'There is no such user'
else:
return self.name[user_id]

def TowerOfHanoi(n , source, destination, auxiliary):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

This method lacks the required 'self' parameter for an instance method. Additionally, the recursive calls will raise a NameError because the function names are not in the global scope. Either add 'self' and call via 'self.TowerOfHanoi', or use the @staticmethod decorator. This complex logic currently lacks any unit test coverage.

See Complexity in Codacy
See Coverage in Codacy

if n==1:
print ("Move disk 1 from source",source,"to destination",destination)
return
TowerOfHanoi(n-1, source, auxiliary, destination)
print ("Move disk",n,"from source",source,"to destination",destination)
TowerOfHanoi(n-1, auxiliary, destination, source)


def fibonacci_of(n):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

This method is missing the 'self' parameter. Add 'self' and update recursive calls to 'self.fibonacci_of(n - 1)', or move the function outside the class definition.

if n in {0, 1}: # Base case
return n
return fibonacci_of(n - 1) + fibonacci_of(n - 2) # Recursive case

if __name__ == '__main__':
person = Person()
print('User Abbas has been added with id ', person.set_name('Abbas'))
print('User associated with id 0 is ', person.get_name(0))
print('User associated with id 0 is ', person.get_name(0))
eval("person.get_name(0)")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

The use of eval() is a significant security risk (code injection). Use safer alternatives like getattr() or call the method directly.

Suggested change
eval("person.get_name(0)")
person.get_name(0)

eval("fibonacci_of(3)")
4 changes: 3 additions & 1 deletion python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
flask==1.0.2
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

Flask version 1.0.2 is severely outdated and contains known security vulnerabilities (CVE-2023-30861) related to session management. Update to a supported version.

Suggested change
flask==1.0.2
flask==2.2.5

See Issue in Codacy

django==1.11.29
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

Django 1.11.29 is end-of-life and insecure. Upgrade to at least 4.2.26 to mitigate critical SQL injection risks (CVE-2025-64459) and other high-severity vulnerabilities.

Suggested change
django==1.11.29
django==4.2.26

See Issue in Codacy

requests==2.19.1
requests==2.19.1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

Upgrade the requests library to version 2.32.4 or higher to prevent sensitive credential leakage in malicious URLs (CVE-2024-47081).

Suggested change
requests==2.19.1
requests==2.32.4

See Issue in Codacy

PyYAML==5.3

Check failure on line 4 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L4

Insecure dependency pypi/pyyaml@5.3 (CVE-2020-14343: PyYAML: incomplete fix for CVE-2020-1747) (update to 5.4)

Check failure on line 4 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L4

Insecure dependency pypi/pyyaml@5.3 (CVE-2020-1747: PyYAML: arbitrary command execution through python/object/new when FullLoader is used) (update to 5.3.1)
Pillow==8.2.0

Check warning on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2021-23437: python-pillow: possible ReDoS via the getrgb function) (update to 8.3.2)

Check failure on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2021-34552: python-pillow: Buffer overflow in image convert function) (update to 8.3.0)

Check warning on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2022-22815: python-pillow: improperly initializes ImagePath.Path in path_getbbox() in path.c) (update to 9.0.0)

Check warning on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2022-22816: python-pillow: buffer over-read during initialization of ImagePath.Path in path_getbbox() in path.c) (update to 9.0.0)

Check failure on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2022-22817: python-pillow: PIL.ImageMath.eval allows evaluation of arbitrary expressions) (update to 9.0.1)

Check warning on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2022-24303: python-pillow: temporary directory with a space character allows removal of unrelated file after im.show() and related actions) (update to 9.0.1)

Check warning on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2022-45198: Pillow before 9.2.0 performs Improper Handling of Highly Compressed GI ...) (update to 9.2.0)

Check warning on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2023-44271: python-pillow: uncontrolled resource consumption when textlength in an ImageDraw instance operates on a long text argument) (update to 10.0.0)

Check warning on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2023-4863: libwebp: Heap buffer overflow in WebP Codec) (update to 10.0.1)

Check failure on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2023-50447: pillow: Arbitrary Code Execution via the environment parameter) (update to 10.2.0)

Check warning on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2024-28219: python-pillow: buffer overflow in _imagingcms.c) (update to 10.3.0)

Check warning on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2026-42308: Pillow: python: Pillow: Denial of Service via integer overflow in font processing) (update to 12.2.0)

Check warning on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (CVE-2026-42310: Pillow: Pillow: Denial of Service via malicious PDF processing) (update to 12.2.0)

Check notice on line 5 in python/requirements.txt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

python/requirements.txt#L5

Insecure dependency pypi/pillow@8.2.0 (GHSA-4fx9-vc88-q2xc: Infinite loop in Pillow) (update to 9.0.0)
4 changes: 0 additions & 4 deletions python/test_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ def test_person(self):
person.set_name('yay')
self.assertEqual(person.get_name(0), 'yay')

def test_person2(self):
person = Person()
person.set_name('yay2')
self.assertEqual(person.get_name(0), 'yay2')

if __name__ == '__main__':
unittest.main()