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

Add compliant and noncompliant examples of python/[email protected] #80

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ankit-amazon
Copy link
Contributor

Description of changes:

}
],
"source": [
"# Compliant: even though there are 2 different types assigned to variable `z`, it is only used within the same cells.\n",

Choose a reason for hiding this comment

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

Even though there are 2 different types assigned to variable z in two different cells, it is only used within one of the two cells.

Copy link
Contributor

@san2488 san2488 left a comment

Choose a reason for hiding this comment

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

DetectorLibrary only supports .py files.

],
"source": [
"# Noncompliant: variable `z` is assigned to 2 different types of values in above cells 3 and 4. \n",
"# Then in cell 5, the value of `z` is used in a `print()` call.\n",

Choose a reason for hiding this comment

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

Then in cell 5, the value of z is used in a print() call, which can have different result depending on the execution order of cells. \n"

# SPDX-License-Identifier: Apache-2.0

# {fact [email protected] defects=1}
# —— Code Cell 1, Execution Count 1 —— #

Choose a reason for hiding this comment

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

In this example, remove all Execution Count, as this information is not needed
Write this.
# —— Code Cell 1—— #

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.

3 participants