Skip to content

Update demo_code.py#5

Open
parthsharma2 wants to merge 1 commit intoTransientOrg:masterfrom
parthsharma2:patch-1
Open

Update demo_code.py#5
parthsharma2 wants to merge 1 commit intoTransientOrg:masterfrom
parthsharma2:patch-1

Conversation

@parthsharma2
Copy link

No description provided.

@enterprise-deepsource-icu
Copy link

Here's the code health analysis summary for commits 8de8b21..18b3c1d. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 3 occurences introduced
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@parthsharma2 parthsharma2 reopened this Dec 3, 2025
@deepsource-development
Copy link

deepsource-development bot commented Dec 3, 2025

Here's the code health analysis summary for commits 8de8b21..18b3c1d. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 3 occurences introduced
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@parthsharma2 parthsharma2 reopened this Dec 3, 2025
@deepsource-development
Copy link

Here's the code health analysis summary for commits 8de8b21..18b3c1d. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython🔄 PendingAnalysis in progress...View Check ↗
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗
DeepSource Secrets LogoSecrets✅ Success
🎯 2 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@deepsource-development
Copy link

deepsource-development bot commented Feb 2, 2026

Here's the code health analysis summary for commits 8de8b21..18b3c1d. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 40 occurences introduced
View Check ↗
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗
DeepSource Secrets LogoSecrets✅ Success
🎯 2 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@deepsource-development
Copy link

deepsource-development bot commented Feb 2, 2026

Here's the code health analysis summary for commits 8de8b21..18b3c1d. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 4 occurences introduced
View Check ↗
DeepSource Secrets LogoSecrets✅ Success
🎯 1 occurence resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@deepsource-development
Copy link

Here's the code health analysis summary for commits 8de8b21..18b3c1d. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 4 occurences introduced
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@deepsource-development
Copy link

Here's the code health analysis summary for commits 8de8b21..18b3c1d. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 40 occurences introduced
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@deepsource-development
Copy link

Here's the code health analysis summary for commits 8de8b21..18b3c1d. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 40 occurences introduced
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@deepsource-development
Copy link

Here's the code health analysis summary for commits 8de8b21..18b3c1d. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 40 occurences introduced
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@deepsource-development
Copy link

DeepSource Code Review

DeepSource reviewed changes in the commit range 8de8b21..18b3c1d on this pull request. Below is the summary for the review, and you can see the individual issues we found as review comments.

For detailed review results, please see the PR on DeepSource ↗

Code Review Summary

Analyzer Status Summary Details
Python 32 new issues detected. 32 existing issues fixed. Review ↗
How are these analyzer statuses calculated?

Administrators can configure which issue categories are reported and cause analysis to be marked as failed when detected. This helps prevent bad and insecure code from being introduced in the codebase. If you're an administrator, you can modify this in the repository's settings.


💡 If you're a repository administrator, you can configure the quality gates from the settings.

@deepsource-development
Copy link

deepsource-development bot commented Feb 10, 2026

DeepSource Code Review

DeepSource reviewed changes in the commit range afe95c8..18b3c1d on this pull request. Below is the summary for the review, and you can see the individual issues we found as review comments.

For detailed review results, please see the PR on DeepSource ↗

PR Report Card

Security × 4 issues Overall PR Quality   

Focus Area: Reliability

Guidance
Fix multiple critical issues including dangerous default arguments and undefined variables in demo_code.py.

Grade capped at D due to multiple critical issues
Reliability × 14 issues
Complexity × 5 issues
Hygiene × 10 issues

Code Review Summary

Analyzer Status Summary Details
Python 33 new issues detected. 32 existing issues fixed. Review ↗
Secrets No new issues detected. Review ↗
How are these analyzer statuses calculated?

Administrators can configure which issue categories are reported and cause analysis to be marked as failed when detected. This helps prevent bad and insecure code from being introduced in the codebase. If you're an administrator, you can modify this in the repository's settings.

@deepsource-io
Copy link

deepsource-io bot commented Feb 12, 2026

DeepSource Code Review

DeepSource reviewed changes in the commit range afe95c8..18b3c1d on this pull request. Below is the summary for the review, and you can see the individual issues we found as review comments.

For detailed review results, please see the PR on DeepSource ↗

PR Report Card

Security × 4 issues Overall PR Quality   

Focus Area: Reliability

Guidance
Fix 3 critical issues with dangerous default values and undefined variables in demo_code.py.

Grade capped at D due to multiple critical issues
Reliability × 14 issues
Complexity × 5 issues
Hygiene × 10 issues

Code Review Summary

Analyzer Status Summary Details
Python 33 new issues detected. 32 existing issues fixed. Review ↗
Secrets No new issues detected. Review ↗
How are these analyzer statuses calculated?

Administrators can configure which issue categories are reported and cause analysis to be marked as failed when detected. This helps prevent bad and insecure code from being introduced in the codebase. If you're an administrator, you can modify this in the repository's settings.

def get_float(self, f):
raise NotImplemented

def get_number(self, min_max):
Copy link

Choose a reason for hiding this comment

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

Method doesn't use the class instance and could be converted into a static method


The method doesn't use its bound instance. Decorate this method with @staticmethod decorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods here.

raise NotImplemented

def get_number(self, min_max):
raise NotImplemented
Copy link

Choose a reason for hiding this comment

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

Raising NotImplementedType while only classes or instances are allowed


Raising objects other than a class, an instance or a string can cause a TypeError.

There can be cases where the value being raised is dynamically set. One common example is initially setting the value to None and assigning other objects based on a condition. Doing so can affect readability and is generally not recommended. In such cases, either re-write the block or ignore the issue for this file.

raise NotImplemented

def get_number(self, min_max):
raise NotImplemented
Copy link

Choose a reason for hiding this comment

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

'raise NotImplemented' should be 'raise NotImplementedError'


While returning NotImplemented would be fine, raising it doesn't work and will cause a TypeError because NotImplemented is not an exception type.

self.limits = (1, 10)

def get_float(self, f):
raise NotImplemented
Copy link

Choose a reason for hiding this comment

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

raise NotImplemented causes TypeError at runtime


The code raises NotImplemented, which is a special singleton value, not an exception. This will cause a TypeError to be raised at runtime, which can be misleading and obscure the developer's intent.

Replace NotImplemented with NotImplementedError() to correctly signal that a method is abstract.

self.limits = (1, 10)

def get_float(self, f):
raise NotImplemented

Choose a reason for hiding this comment

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

NotImplemented constant raised instead of NotImplementedError exception


The code raises NotImplemented, which is a special singleton value used in rich comparison methods, not an exception. Attempting to raise it will result in a TypeError at runtime.

To indicate that an interface method must be implemented by subclasses, NotImplementedError should be raised instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants