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

Command line deduplication #1517

Merged
merged 1 commit into from
May 8, 2018

Conversation

csordasmarton
Copy link
Contributor

In the command line (diff and print commands ) the results in the same header files should be shown and counted only once even if they were found multiple times because multiple c/cpp files included them.

Closes #1465 and Closes #1512.

@csordasmarton csordasmarton added enhancement 🌟 CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands bugfix 🔨 documentation 📖 Changes to documentation. labels Apr 13, 2018
@csordasmarton csordasmarton requested a review from gyorb April 13, 2018 13:16
@csordasmarton csordasmarton force-pushed the cmd-filter-deduplications branch from d93acfa to 80c65b2 Compare April 17, 2018 09:06
Copy link
Contributor

@gyorb gyorb left a comment

Choose a reason for hiding this comment

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

Please add a unit test for get_report_path_hash

@@ -590,3 +590,24 @@ def trim_path_prefixes(path, prefixes):
return path

return path[len(longest_matching_prefix):]


def get_report_path_hash(report, files):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be better to put this into libcodechecker/report.py so every report related function is there. It could be a static method of the Report class there.

@csordasmarton csordasmarton force-pushed the cmd-filter-deduplications branch from 80c65b2 to c89b8c6 Compare April 19, 2018 09:27
@csordasmarton csordasmarton requested a review from gyorb April 19, 2018 10:06
@@ -158,7 +158,8 @@ def arg_match(options):
parser.set_defaults(func=__handle)


def parse(f, context, metadata_dict, suppress_handler, skip_handler, steps):
def parse(f, context, metadata_dict, suppress_handler, skip_handler,
processed_path_hashes, steps):
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer to extend the function arguments at the end if possible. It is really easy to mix up different type of arguments in python.

@@ -147,6 +146,27 @@ def compare_ctrl_sections(curr, prev):
return ''


def get_report_path_hash(report, files):
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add function documentation.

@csordasmarton csordasmarton force-pushed the cmd-filter-deduplications branch from c89b8c6 to 1cfae29 Compare May 7, 2018 07:47
@csordasmarton csordasmarton requested a review from gyorb May 7, 2018 07:47
In the command line (diff and print commands ) the results in the
same header files should be shown and counted only once even if
they were found multiple times because multiple c/cpp files
included them.
@csordasmarton csordasmarton force-pushed the cmd-filter-deduplications branch from 1cfae29 to bc1da80 Compare May 8, 2018 12:05
@gyorb gyorb merged commit 6d9b95f into Ericsson:master May 8, 2018
@csordasmarton csordasmarton deleted the cmd-filter-deduplications branch May 9, 2018 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix 🔨 CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands documentation 📖 Changes to documentation. enhancement 🌟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants