Navigation Menu

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

Static Analyzers: Add checker for use of edm::ParameterSet::exists or ::existsAs<T>. #36424

Merged
merged 7 commits into from Dec 10, 2021

Conversation

gartung
Copy link
Member

@gartung gartung commented Dec 8, 2021

Tested on PhysicsTools/PatAlgos which makes use of both. Examples of test output to console:

In file included from PhysicsTools/PatAlgos/plugins/VertexAssociationProducer.cc:23:
PhysicsTools/PatAlgos/interface/VertexingHelper.h:35:13: warning: function edm::ParameterSet::existsAs<double>(const std::basic_string<char, std::char_traits<char>, std::allocator<char> > &, _Bool) const is called in function reco::modules::ParameterAdapter<pat::VertexAssociationSelector>::make(const edm::ParameterSet &) [cms.CodeRules.psetExistsChecker]
        if (iConfig.existsAs<double>("deltaZ"))
            ^       ~~~~~~~~
PhysicsTools/PatAlgos/plugins/PATTriggerProducer.cc:219:7: warning: function edm::ParameterSet::exists(const std::basic_string<char, std::char_traits<char>, std::allocator<char> > &) const is called in function pat::PATTriggerProducer::PATTriggerProducer(const edm::ParameterSet &) [cms.CodeRules.psetExistsChecker]
  if (iConfig.exists("addL1Algos"))
      ^       ~~~~~~

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 8, 2021

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36424/27242

  • This PR adds an extra 16KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@makortel
Copy link
Contributor

makortel commented Dec 8, 2021

/build/gartung/CMSSW_12_2_X_2021-11-29-2300/src/PhysicsTools/PatAlgos/interface/VertexingHelper.h:35:13: warning: deprecated function edm::ParameterSet::existsAs(const std::basic_string<char, std::char_traits, std::allocator > &, _Bool) const is called in function reco::modules::ParameterAdapterpat::VertexAssociationSelector::make(const edm::ParameterSet &) [deprecated.psetExistsChecker]

Rather than Deprecated, I would maybe place this check under "CMS code rules" (we recommend to avoid them, even if we don't mention them explicitly in the code rules).

@makortel
Copy link
Contributor

makortel commented Dec 8, 2021

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 8, 2021

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36424/27244

  • This PR adds an extra 16KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 8, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36424/27246

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36424/27273

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2021

Pull request #36424 was updated. @cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please check and sign again.

@makortel
Copy link
Contributor

makortel commented Dec 9, 2021

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-ec95de/21138/summary.html
COMMIT: b3b81a4
CMSSW: CMSSW_12_3_X_2021-12-09-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/36424/21138/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 42
  • DQMHistoTests: Total histograms compared: 3250704
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3250682
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 41 files compared)
  • Checked 177 log files, 37 edm output root files, 42 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Contributor

makortel commented Dec 9, 2021

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2021

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@qliphy
Copy link
Contributor

qliphy commented Dec 10, 2021

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants