Источник:
http://dynamicsuser.net/nav/b/waldo/...blished-events
==============
Blogging has been low lately. I have been insanely busy with providing content for the Cloud SureStep for Product Development on the DLP, which means: less free time :(.
But ..
Together with a brilliant colleague, I’m also working on an internal project: A
code analyzer in PowerShell. Why in PowerShell .. well .. because in my opinion, it belongs there: I just don’t know what I want to analyze just yet
and when I do know, I want to be able to create it within minutes, and put it in my test-library as some kind of automated test or part of my build server or wherever I want it .. .
The tool is something that understands NAV Code (C/AL, C/SIDE Objects, …) to be able to analyze them.. . And we’re getting quite far with it. Unfortunately, this is not something that I can put up for free .. but I can put up some “output” of the tests that I have been doing with it. Today, my first “output”:
All information on the published events of NAV2016
You might remember my blog “
NAV 2016 Eventing: All published Integration and Business events“. I provided a script that showed all the Events in NAV. Well .. I wanted to know more. Much more! I wanted to know:
- Which events are there (ok, this I already had)
- How many times are they raised
- Where are they declared
- Where are they raised
So all information on the
publishers that I could find.
At the end of this post, you can find the result. On top, you first have a table with two columns: “the number of times the publisher was raised”, and “the key of the element that identifies the publisher”. I think the key is readable enough ;-). You can use this key to search further in the output, for all the places it was raised. I mark the line in code of where it was raised.. .
Call for Feedback / Ideas
This was actually just an example for me to test the tool, but the result is quite interesting. If you have any
feedback on this output, if you want to show it in some other way, or if you would like to know even more on publishers ..
Please provide a comment and let me know.
Or even better: if you’re interested in any other kind of analysis on NAV, again, please let me know – and I might just do it, and put it online as well ;-).
I’m currently thinking of:
- Analyzing COMMITs (how many, where, …)
- Cyclomatic Complexity
- Duplicate Control Ids (although this is not interesting in default NAV)
Waldo, finally show me the output
Here it is:
Number of times a publisher was raised: 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 3 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 12 : Codeunit.PROCEDURE 12 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 12 : Codeunit.PROCEDURE 12 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 2 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Codeunit.PROCEDURE 1 : Report.PROCEDURE 1 : Table.PROCEDURE 1 : Table.PROCEDURE 1 : Table.PROCEDURE 1 : Table.PROCEDURE 4 : Table.PROCEDURE 1 : Table.PROCEDURE 1 : Table.PROCEDURE 1 : Table.PROCEDURE 1 : Table.PROCEDURE 1 : Table.PROCEDURE 1 : Table.PROCEDURE 1 : Table.PROCEDURE 3 : Table.PROCEDURE 1 : Table.PROCEDURE 3 : Table.PROCEDURE 3 : Table.PROCEDURE 3 : Table.PROCEDURE 1 : Table.PROCEDURE 1 : Table.PROCEDURE 1 : Table.PROCEDURE 6 : Table.PROCEDURE DETAILS: Codeunit.PROCEDURE Raised in: Codeunit.PROCEDURE Code lines: AutoFormatTranslation := AutoFormatManagement.AutoFormatTranslate(AutoFormatType,AutoFormatExpr); OnAfterAutoFormatTranslate(AutoFormatType,AutoFormatExpr,AutoFormatTranslation);