odpi / egeria-connector-ibm-information-server

IBM Information Server connectors for Egeria: repository proxy connector for IGC, data engine proxy connector for DataStage.
https://odpi.github.io/egeria-connector-ibm-information-server
Apache License 2.0
26 stars 20 forks source link

SonarCloud Quality Gate Code duplication rule too restrictive #744

Open lpalashevski opened 1 year ago

lpalashevski commented 1 year ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 14 Code Smells

No Coverage information No Coverage information
9.0% 9.0% Duplication

Originally posted by @sonarcloud[bot] in https://github.com/odpi/egeria-connector-ibm-information-server/issues/743#issuecomment-1202728322

lpalashevski commented 1 year ago

Checking for code duplication is most of the times very useful. However, also many times it is not easy to configure rule on how duplication is detected for given context and coding style.

Some of the Egeria frameworks and patterns in the code especially when writing connector are contradicting this to some extend and code gets duplicated. Example is where we are writing two connector provides/connectors to achieve same goal in different way. In cases like this we have to think about code duplication for limited scope (connector) and not across all connectors.

We are trying to keep this practice to minimum but there will be cases where duplicating code is just fine.

Default code duplication quality check we are using at the moment is <=3%. This is too restrictive and it is blocking us at the moment.

We need either to find smarter way to configure the rule (not sure if tools support this) or just simply increase the duplication threshold for certain repos.

any other thoughts?

cc: @planetf1

planetf1 commented 1 year ago

Agree with your summary

Some work is needed to add the GitHub action to run the scan on the repositories we are interested in. I've been doing this before vacation for the new HMS connector, though have a glitch to resolve. Once done we can adopt that pattern across our other repos that are not currently fully scanning (including this one)

planetf1 commented 1 year ago

I opened https://github.com/odpi/egeria/issues/6805 to track getting our sonar scan working across all repos