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

Added a .sourceCode attribute to Elements, and a check for the age di… #145

Merged
merged 8 commits into from
Apr 20, 2021

Conversation

izar
Copy link
Collaborator

@izar izar commented Mar 22, 2021

…fference (in days) between the source code and the model.

~/Src/pytm source_and_check* ❯ ./tm.py --stale 200
Checking for code 200 days older than this model.
Paths should be relative to the directory where the TM script is being run.

~/Src/pytm source_and_check* ❯ ./tm.py --stale 20
Checking for code 20 days older than this model.
Paths should be relative to the directory where the TM script is being run.

./pytm/json.py is 175 days older than this model.

…fference (in days) between the source code and the model.
@izar izar requested review from nineinchnick and colesmj March 22, 2021 20:44
Copy link
Collaborator

@nineinchnick nineinchnick left a comment

Choose a reason for hiding this comment

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

I'm not sure the relationship between a model and the sources of a system is so simple. This will be confusing if we imply it's required to identify source files to complete a model. And the requirement to update either the model or sources should be verified during code review of either one.

@ghost
Copy link

ghost commented Mar 22, 2021

Congratulations 🎉. DeepCode analyzed your code in 2.643 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

👉 View analysis in DeepCode’s Dashboard | Configure the bot

pytm/pytm.py Outdated

for src in e.sourceCode:
src_mtime = datetime.fromtimestamp(
os.stat(os.path.dirname(sys.argv[0]) + f"/{src}").st_mtime
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like the assumption that all source files must be in the same dir as the threat model script. Either document it, or detect and allow using absolute paths.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm open to be convinced otherwise, but my intent has always been that the model lives together with the code it represents. Meanwhile I've documented it in the variable doc.

Izar Tarandach and others added 2 commits April 8, 2021 10:06
@izar izar added this to the v1.1.3 milestone Apr 12, 2021
@izar izar merged commit 45bbafd into master Apr 20, 2021
@izar izar deleted the source_and_check branch April 20, 2021 16:42
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