Analyzing SharePoint Solutions with MOSCAF – Part II
To get articles like this free in your inbox, subscribe to our newsletter.
In this article I will continue talking about how to use the capabilities provided by MSOCAF (Microsoft SharePoint Online Code Analysis Framework) for auditing a SharePoint environment in terms of .WSP solutions deployed. If you remember, in my last post about MSOCAF we simply reviewed how to install and use the tool in a CloudShare SharePoint development environment. In this blog post I will continue showing you how MSOCAF is a great tool for analyzing SharePoint solutions and detect any problems introduced by them in a SharePoint farm.
Analyzing a set of WSP solutions to be deployed in a SharePoint environment
In my scenario I have a set of WSP solutions provided by my development team that need to be reviewed and analyzing before being deployed to the pre-production and production environments:
- MSOCAF is perfect in this situation since it allows to analyze several SharePoint solutions in the same process. As you can see in the screenshot, MSOCAF has detected some issues and errors in the analysis. In order to have a more detailed information about the problems found by MSOCAF, I recommend you to use the “Export to excel” and / or “Export to browser” functionality provided by the tool.
- Both approaches, “Export to Excel” or “Export to Browser”, provide a great detail about all the errors and warnings generated by MSOCAF after analyzing all the WSPs. As you can see in the Excel file generated, you have the ability to filter the data applying different filters like the test cases used by MSOCAF: “Design”, “Memory management”, “Security”, etc. Additionally, you can apply additional filters in order to narrow specific errors and warnings.
- If we opt to use the “Export to Browser” option, the analysis results are shown in a different way compared to the Excel one. Basically, for each analysis rule applied by MSOCAF we can see the problems and warnings found during the analysis process.
- Of course, in order to understand the analysis rules applied by MSOCAF you can always go back in the analysis wizard and review the test cases being applied.
- As you can see, MSOCAF applies a set of test cases labeled as “Microsoft Online custom rules”. These test cases allow to measure various aspects in the WSPs analyzed such as possible performance problems, design errors, and so on. If you want to know the details about these cases, it’s recommendable to review MOSCAF’s Help.
- MOSCAF’s Help file includes a “Custom Rules” section where you can review the details for each rule applied in each test case.
- For instance, the details for “Check for Use of SP.List.Items” rule are the following:
(a) Check for Use of SPList.Items
If any of the instructions contains the SPList.Items object, MSOCAF will generate an error.
If you encounter problems:
Remove the SPList.Items object from the instructions. For retrieving items in a list, use SPList.GetItems (SPQuery query).For more details, see the MSDN article Best Practices: Common Coding Issues When Using the SharePoint Object Model.
And that’s all in this second article about how to use MSOCAF to analyze SharePoint Solutions. Happy CloudSharing!
What you should do next…
1. Subscribe to our newsletter:
2. Learn how virtual labs can grow your business:
To learn more about how CloudShare helps software organizations grow revenue, increase efficiency and improve quality, visit our resources page. You’ll be able to browser dozens of valuable white papers, eBooks, webinars, case studies, and brochures.
3. Get a FREE, no obligation demo:
Discover just how easy it is to create your cloud environment—in minutes! One of our friendly virtual labs experts will be happy to:
- Show you the platform in action
- Calculate pricing for your business
- Set you up with a 14-day free trial
- Answer any questions you have
- No pressure or obligation