Skip to content

Commit

Permalink
refactor: refactor unnecessary else / elif when if block has a …
Browse files Browse the repository at this point in the history
…`raise` statement

`raise` causes control flow to be disrupted, as it will exit the block.
It is recommended to check other conditions using another `if` statement, and get rid of `else` statements as they are unnecessary.
  • Loading branch information
deepsource-autofix[bot] authored Jan 16, 2024
1 parent 8abd2da commit f2212f8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions codeinsight_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ def inventories(self):
def experimental(self) -> ExperimentalHandler:
if self.experimental_enabled == False:
raise CodeInsightError("Experimental API is not enabled for this instance")
else:
return ExperimentalHandler(self)
return ExperimentalHandler(self)

# Coming soon...?

Expand Down

0 comments on commit f2212f8

Please sign in to comment.