[NEW PLUGIN] Magento 2 ruleset - Requesting inclusion in SonarQube Marketplace

Hi. I would like to share a plugin that helps to analyze code quality when developing on Magento 2 CMS platform taking into account the peculiarities of this platform

3 Likes

Hi,

Congrats on your plugin.

Most of the bureaucratic requirements look okay except #7. I see that the project is analyzed on SonarQube Cloud, but the Quality Gate isn’t green (because there’s only been one analysis).

Beyond that, could you provide me a project for testing this with?

 
Thx,
Ann

Hi. Thanks. Glad to hear that almost all conditions are met

Ah, missed the point with the reanalysis. I’ll do that a little later.
In the meantime : here’s a rundown of the pre-release analysis : v.1.3.0 by rostilos · Pull Request #5 · rostilos/sonarqube-magento2-rules · GitHub

About the project - you can take any M2 version to check if it works correctly

Or any custom module, e.g.

Hi,

Talk to me like I’m 5. I just check one of these repos out and point analysis at it? Or is there more to it?

 
Thx,
Ann

Yes, one of those git repositories.
It is enough to include only app/** directory in the analysis (in case of official repository), and analyze with included ruleset from the SQ rules repository with magento2 key

Also ran a reanalysis. Quality Gate passed

Hi,

Thanks for the testing help.

This plugin seems generally well-behaved (no errors in the server logs & analysis logs look normal.)

And I’m wondering if some of your rule descriptions don’t reflect reasoning that’s purely internal to your organization and could use a cleanup for general consumption?

E.G.

  • magento2:ImportsFromTestNamespace

    Time to time we’re getting issue with running tests on PRs in magento/magento2 repository because someone imported \Magento\Tests\NamingConvention\true\string by mistake. As result - we have “No build reports available” for “Database Compare build”, “Functional Tests build”, “Sample Data Tests build” while Static tests are shown as “failing” but in results - we don’t really have reason

That said, the rule descriptions in general are nicely detailed. Well done.

I’ll proceed with the PR.

And I ask that you consider reviewing your descriptions for the next release.

 
Ann

Thank you very much for the quick feedback.

I will take into account all comments about the plugin and PR to SQ repo.

But I must warn you that I won’t be able to make any edits today as I’m no longer at the PC.

Regarding the above description - hmmm, really incorrect interpretation, but it’s not a design specificity of my organization, but a random copy-paste from adobe’s tech guidelines description

Thanks again

1 Like

Hi. I noticed that the PR has been accepted and the plugin has appeared on Marketplace, can this be considered a great success, or will there be more checks)?

Hi,

Nope. No more checks. You’re in!

 
:tada:
Ann

1 Like

I didn’t expect it to be so fast))
Thank you for your help and quick processing of the request!