QAPlug Tutorial: Code Review & Integration
QAPlug Tutorial: Code Review & Integration
Current Releases
QAPlug Blog
[Link] Page 1 of 10
Tutorial – QA Plug 2023/5/1, 23:52
Vendor
(/wp-content/uploads/qaplug_creating_pro4le.png)
You are also able to 4ll speci4c parameters of the coding rules options.
[Link] Page 2 of 10
Tutorial – QA Plug 2023/5/1, 23:52
(/wp-content/uploads/coding_rules_options_large.png)
You are able to import several coding rules conOguration Oles (eg. Checkstyle, PMD, FindBugs) to one pro4le
simply be repeating import action.
You are also able to export your analysis pro4le to xml con4guration 4le.
Please notice that you are able to decide which modules will be exported.
Generated 4le format depends on the selected modules.
[Link] Page 3 of 10
Tutorial – QA Plug 2023/5/1, 23:52
If you want to use generated 4le in your own tool (FindBugs, PMD, Checkstyle, Sonar, etc.) without any
modi4cations, then you should select only one module at once.
QAPlug Actualization
You can check if QAPlug and its submodules are up to date in QAPlug Settings window.
(Main menu: Settings | QAPlug).
(/wp-content/uploads/qaplug_actualization_large.png)
[Link] Page 4 of 10
Tutorial – QA Plug 2023/5/1, 23:52
(/wp-content/uploads/on_the_@y_checks_activate_qaplug_inspection.png)
Please remeber that QAPlug Real-Time Analysis is using Default Project proOle.
If you want to change this pro4le, please use Coding Rules settings tab.
(/wp-content/uploads/coding_rules_how_to_change_default_pro4le.png)
After that step, changes done by you in the code will aNect results of the analysis.
(/wp-content/uploads/on-the-@[Link])
Sonar is an open source quality management platform, dedicated to continuously analyze and measure source
code quality. It allows you to analyze code using the most popular coding rules like: Checkstyle, Findbugs and
PMD.
Usually, the Sonar code analysis is performed only once or twice a day. What about the situation when we need a
real time analysis?
In this case we can use QAPlug and import coding rules from Sonar.
See how to do that in the steps below:
[Link] Page 5 of 10
Tutorial – QA Plug 2023/5/1, 23:52
(/wp-
content/uploads/[Link])
(/wp-
content/uploads/[Link])
3. After login, click on ‘Con4guration’ button to set your customized coding rules.
(/wp-content/uploads/coding_rules_how_to_change_default_pro4le.png)
(/wp-
content/uploads/[Link])
4. Click on your pro4le name. (in this case ‘Mifos’).
Home ConfigurationAdministrator»Logout&Search
QualityProfiles EnSomeareprofiles. Restorepretle
EventCategories
Javaprofiles (Create
DefantFilters Name Projects Operations
MIR*
DefaultDashboards 10 Rename CODY
MyProfile
115 Setasdefault Coo
SECURITY
SonarwaywithFindbugs 490 0
Users
Sunchecks 59 COPT
(/wp-
Groups
GiODaRoles
ProjectRoles
PoweredbySonarSourcec-OpenSourceLGPLg-v.2.10-riginso-Documentation-Askaquestionif
SYSTEM
GeneralSettings
EmailSettings
Backup
SystemInfo
Updatecenter
sonar
content/uploads/pro4le_name.png)
5. Modify some rules options and con4rm changes using ‘Update’ button.
SECURITY Sonar Minor
Users Info
Groups
GlobalRoles 10results 4;Download1%BulkChange:
ProjectRoles
ActiveseveritvNameexpandcollaose Plugin
SYSTEM Major AbstractClassWithoutAbstractMethod Pmd
GoneralSettinos
Backuc
Minor AnnotationUseStyle Checkstyle
SystemInfo
opedteconter
WMajor Checkstyle
Checksforlonganonumousinnerclasses.
14
(/wp-
sonar Updatemaximumallowablenumberoflines.Defaultis20.
Key: [Link]
content/uploads/[Link])
6. Click on ‘Home’ button to return to projects page.
[Link] Page 6 of 10
Tutorial – QA Plug 2023/5/1, 23:52
Homs ConfigurationAdministrator»Logout#Search
QualityProfiles Qualityprofiles/java/Mifos
EventCategories
MATTERMOTTES
Codingrules Alerts Projects Permalinks ProfileInheritance Changelag
GrOnos
GiODaRoles
10results E;Download&BulkChange:
ProjecURoles
(/wp-
Active/SeverityName[expandicollapse] Plugin
SYSTEM Major AbstractClassWithoutAbstractMethod Pmd
Generalsettings
EmailSettings
BMajor Abstractnaming Pmd
Backun
AnnotationUseStyle Checkstyle
SystemInfo
UndateCenter AnonInnerLength Checkstyle
Checksforlonganonymousinnerclasses.
14 QUpdate maximumallowablenumberoflines.Defaultis20.
sonar
Key: [Link]
AvoldInlineConditionals Checkstyle
Malor
AvoidNestedBlocks Checkstyle
FindsnestedDIocks
content/uploads/[Link])
Note: To see modi4ed settings in code rules you should rebuild project(using for example command: mvn
sonar:sonar).
(/wp-
content/uploads/[Link])
8. In Sonar ‘Dashboard’ area, select severity of previously modi4ed rule.
(/wp-
content/uploads/[Link])
9. In ‘Violations Drilldown’ area select modi4ed rule and check error in code.
(/wp-
content/uploads/[Link])
10. Now you’ve checked that modi4ed rules are properly working in Sonar.
The next thing to do is to export that modi4ed rules into QAPlug. To do that you can use Permalinks.
11. Return to ‘Con4guration’ area and select your pro4le.
[Link] Page 7 of 10
Tutorial – QA Plug 2023/5/1, 23:52
Home ConfigurationAdministrator»Logout&Search
QualityProfiles EnSomeareprofiles. Restorepretle
EventCategories
Javaprofiles (Create
DefantFilters Name Projects Operations
MIR*
DefaultDashboards 10 Rename CODY
MyProfile
115 Setasdefault Coo
SECURITY
SonarwaywithFindbugs 490 0
Users
Sunchecks 59 COPT
(/wp-
Groups
GiODaRoles
ProjectRoles
PoweredbySonarSourcec-OpenSourceLGPLg-v.2.10-riginso-Documentation-Askaquestionif
SYSTEM
GeneralSettings
EmailSettings
Backup
SystemInfo
Updatecenter
sonar
content/uploads/pro4le_name1.png)
[Link]
HAmo
ConfigurationAdministrator»Logout=Search
QualityProfiles Qualityprofiles/java/Mitos
EventCategories
Codingrules Alerts Prolects Permalinks ProfileInheritance Changelog
Manualmetries
Users Info
Backuo
Minor AnnotationUseStyle INKSTITTE
SystemInfo
UpdateCenter Major AnonInnerength Checkstyle
[Link]
content/uploads/[Link])
13. In ‘Permalinks’ tab, right-click on link for chosen coding rule and select ‘Save target as…’
Home Configuration#Administrator»Logout%Scarch
QualityProfiles Qualityprofiles/java/Mifos
EventCategories
manuannonneo
Codingrules Alerts Projects PermalinksProfileinheritance Changelog
DefanitFiliers
DefaultDashboards Checkstvle
http//localhost:9.000/orofles/export?tormat-check Open
MyProfile Findbugs OpeninNewWindow
SECURITY
PMD
SeveTarsetdis...
PrintTarget
Users Cut
Groups
(/wp-
PoweredwySonarS Copy &-v.2.10-Blualst-Dosumentatione-Askaquestionin
GiobaRoles CopyShortout
ProjectRoles Poste
SYSTEM
Properties
GeneralSettings
EmailSettings
Backup
SystemInfo
vodateGenier
sonar
content/uploads/[Link])
14. Save permalink as .xml 4le.
Now, you have 4nished all tasks in Sonar. So, the next step is to open IntelliJ IDEA.
QAPlug
-ProjectSettings[mifos-parent] QAPlugisanIntellijIDEAplugintomanagecodequalitywhichintegratestoolssuchasPMD,CheckstyleandFindbugs.
ECodeStyle
BECompiler
ifCopyright Suppressions
rileColors
(/wp-
QAPlug-Check... 1.2.5 1.2.6 isuotodate
PMD
QAPlug-PMD 1.2.5 isdotodate
ReSOUrCas
Scopes
Spelling
EsTasks
TemplateDataLanguages
Itversioncontrol
XSLTFileAssociations
-IDESettings
Appearance
ConsoleFolding
#Debugger
iSEditor
ExternalDiffTools
ExternalTools
FileTemplates
rilelydes
General
content/uploads/[Link])
16. Click on ‘Coding Rules’.
[Link] Page 8 of 10
Tutorial – QA Plug 2023/5/1, 23:52
(/wp-
content/uploads/[Link])
(/wp-
content/uploads/[Link])
(/wp-
content/uploads/[Link])
19. After successfull pro4le import, the summary window will appear.
[Link] Page 9 of 10
Tutorial – QA Plug 2023/5/1, 23:52
(/wp-
content/uploads/[Link])
20. The last step is to check in code that imported rules are working properly. So, open project and analyze code
using QAPlug.
(/wp-
content/uploads/[Link])
Now, you have imported coding rules from Sonar. From this moment, you can check the written code on-the-@y
and 4x errors right away!
Please have in mind that we are planning to simplify and extend the integration of Sonar with QAPlug in the
future.
[Link] Page 10 of 10