AXForum  
Вернуться   AXForum > Microsoft Dynamics NAV > NAV: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 23.01.2018, 08:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,448 / 846 (79) +++++++
Регистрация: 28.10.2006
waldo: Enable Code Analysis for AL
Источник: https://dynamicsuser.net/nav/b/waldo...nalysis-for-al
==============

It’s the week of “undocumented features”, apparently. Today: code analysis. Apparently, the al-language extension comes with a built-in analysis for your al-code. Thing is: it’s disabled by default. Just go to settings (File/Preferences/Settings) and enabled it.



By adding the line to your settings.json of your environment (the right pane). Here is my settings.json-file:



You will get quite a number of “topics” it will analyse your code for. On the points it has issues with, it will show you a green line in your code, and you can see the exact “problem” as a tooltip when you hover over it, or in the “problems”-pane (CTRL+j / Problems). Here are just a few examples:

In this piece of code, I have 3 problems, which you can read below:



When hovering over the symbol with green line, you can see the problem. In this case, an unused variable:



What do you think of this one: you risk an overflow when you use this code:



Or one of my favorites: code that will never get executed:



Can I create my own analysis?

You can, but it’s a little bit cumbersome. You can create your own analysis-dll, drop it in the extension-folder, and go from there. I haven’t had a look at it .. because I’ll wait until this undocumented-but-already-cool-feature gets documented-and-even-cooler and supported, so we are sure that the work we put into it, is worth it. In the mean time: thumbs up, Microsoft!

Performance impact

I was told it does have a performance impact, so I guess that’s why it’s disabled by default. I haven’t noticed too much of an impact myself, to be honest.. but you are warned ;-).




Источник: https://dynamicsuser.net/nav/b/waldo...nalysis-for-al
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
waldo: Microsoft Dynamics NAV Source Code Analysis – Triggers & Procedures Blog bot NAV: Blogs 0 09.03.2017 04:17
waldo: Microsoft Dynamics NAV Source Code Analysis – LineCount Blog bot NAV: Blogs 0 02.03.2017 07:14
waldo: Microsoft Dynamics NAV 2017 – what’s really new? Blog bot NAV: Blogs 0 13.10.2016 05:22
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Вопрос про Demand Planner slava09 DAX: Функционал 4 25.09.2006 11:43
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 14:27.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.