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

[cmd] Do not change directory for parse command #2616

Conversation

csordasmarton
Copy link
Contributor

Closes #1224

@csordasmarton csordasmarton added the CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands label Mar 13, 2020
@gyorb
Copy link
Contributor

gyorb commented Mar 13, 2020

Codacy Here is an overview of what got changed by this pull request:

Complexity decreasing per file
==============================
+ analyzer/codechecker_analyzer/cmd/parse.py  -2
         

See the complete overview on Codacy

Copy link
Contributor

@bruntib bruntib left a comment

Choose a reason for hiding this comment

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

The command CodeChecker parse fails with the following scenario:

  1. Create a source file in a project directory: hello/main.cpp.
  2. Analyze the project to a report directory.
  3. Rename the report directory to hello2.
  4. Use CodeChecker parse command on the report directory.

The crash happens when the command tries to check whether the source file has been modified since the last analysis. Until this patch we got a log message which says "Can not parse reports safely." This means that now the report directory is not portable as @gyorb remarked in #1224.

@gyorb
Copy link
Contributor

gyorb commented Apr 21, 2020

renaming the report directory worked for me with this change, the reports still can be parsed but if the original project was renamed I get this error because of the missing files.

    if file_mtime > plist_mtime:
TypeError: '>' not supported between instances of 'NoneType' and 'float

The original source file is not there anymore, but maybe we should allow the parsing in this case with the limitation that the source files can not be read and the content can not be shown only the data which is available in the plist report will be printed.
I that case at least the printing of the report data will be successful.

For the store command we should still check the source file availability because without that the reports can not be stored.
What do you think @csordasmarton @bruntib ?

@csordasmarton
Copy link
Contributor Author

Closing this pull request as there have been no activity on it in a long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

do not change directory for parse command
3 participants