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

Covscan defect: Error: IDENTICAL_BRANCHES (CWE-398) #121

Open
flo-renaud opened this issue Mar 30, 2022 · 0 comments
Open

Covscan defect: Error: IDENTICAL_BRANCHES (CWE-398) #121

flo-renaud opened this issue Mar 30, 2022 · 0 comments

Comments

@flo-renaud
Copy link

Covscan detects the following error on lesscpy-0.14.0:

Error: IDENTICAL_BRANCHES (CWE-398):
lesscpy-0.14.0/build/lib/lesscpy/plib/mixin.py:65: identical_branches: Ternary expression on condition "hasattr(v, "parse")" has identical then and else expressions: "v". Should one of the expressions be modified, or the entire ternary expression replaced?
#   63|           if self.args:
#   64|               parsed = [
#   65|->                 v if hasattr(v, 'parse') else v for v in copy.copy(self.args)
#   66|               ]
#   67|               args = args if isinstance(args, list) else [args]

The code is still the same in the master branch, also affected by the same error:

v if hasattr(v, 'parse') else v for v in copy.copy(self.args)

and was changed with the commit 64b4960.

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

No branches or pull requests

1 participant