Static Code analysis

Ask general questions here.
mbrees86
Posts: 8
Joined: Mon May 13, 2019 8:30 pm

Static Code analysis

Post by mbrees86 » Wed Aug 07, 2019 6:48 pm

Hi All,

Are there any tools/plugins out there for static code analysis of Ranorex solutions?

Thanks!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11963
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Static Code analysis

Post by Support Team » Wed Aug 07, 2019 8:03 pm

Hi mbrees86,

Ranorex Studio does not have any code analysis tools built into it by default, but you can install FxCop and use it from within Ranorex Studio. Once installed, simply set the FxCop path in the Ranorex settings (pictured below).

1.png
1.png (17.32 KiB) Viewed 99 times

As an alternative, you can open your Ranorex solutions in third-party tools outside of Ranorex studio with better code analysis tools such as Visual Studio (free). If using Visual Studio, the *.sln file can be found in the same directory as the *.rxsln file. (Code Analysis in VS)

2.png
2.png (6.92 KiB) Viewed 99 times

I hope this answers your question!

Regards,
Ned
.
Image

mbrees86
Posts: 8
Joined: Mon May 13, 2019 8:30 pm

Re: Static Code analysis

Post by mbrees86 » Fri Aug 09, 2019 1:33 pm

Thanks for this information Ned. Have you used FXCop? Is it pretty good?

mbrees86
Posts: 8
Joined: Mon May 13, 2019 8:30 pm

Re: Static Code analysis

Post by mbrees86 » Fri Aug 09, 2019 8:27 pm

Also I see how to associate that from the picture below but where the heck do I get it installed at? I can't find any kind of marketplace for Ranorex to get it downloaded? What I found online was a nuget package which also doesn't seem to be able to be installed in Ranorex? Any help is much appreciated!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11963
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Static Code analysis

Post by Support Team » Mon Aug 12, 2019 9:00 pm

Being in a support position, my experience with FxCop is limited since I am usually working on small projects that do not require code analysis. Perhaps one of our many users can chime in with their personal experience with it on larger projects/teams.

I have extracted the installer file directly from my previous link and have it hosted here for simplicity.

You can set FxCop to run automatically each build in the project properties. Once enabled, build the project and you will see any warnings/errors shown in the Errors panel within Ranorex Studio.

1.png
1.png (45.11 KiB) Viewed 45 times
2.png
2.png (15.72 KiB) Viewed 45 times

I hope this helps!

Cheers,
Ned
.
Image