GithubHelp home page GithubHelp logo

vscode-allint's Introduction

AL Lint

The AL Lint extension is designed for AL. The main purpose is to test AL Code against guidelines for clean code.

Marketplace Installs GitHub issues GitHub pull requests License

Features

The extension will check your code as you are working on it. It checks the open file and shows warnings.

Provides two commands

  • Refactor - Move one or more lines of code into a new function or new codeunit. (In Prototype)

  • Clean Code - Check your current object against coding guidelines for clean code. This will generate a summary report. (Not working yet)

Requirements

Some AL code

Extension Settings

  • allint.enabled - enable/disable allint.
  • allint.statusbar - enable/disable statusbar.
  • allint.checkcommit - check code for COMMIT.
  • allint.checkhungariannotation - check code for hungarian notation.
  • allint.hungariannotationoptions - defines Hungarian Notation options.
  • allint.maxnumberoffunctionlines - The limit how many lines a function should have. Blank lines and comments are not taken into account. Set to 0 to deactivate.

Hungarian Notation Options

By default the extension will check the following abbreviations Record,Rec Integer,Int Code,Cod Function,Func Codeunit,Cdu Page,Pag Text,Txt Field,Fld

Which can be changed by modifying the HungarianNotationOptions setting like this "Record,Rec;Integer,Int;Code,Cod;Function,Func;Codeunit,Cdu;Page,Pag;Text,Txt;Field,Fld"

Status Bar Explanation

The status bar will show which function you are editing and its hallstead complexity and cyclomatic complexity.

If the text is green, you are good. Orange and Red should explain itsself.

https://en.wikipedia.org/wiki/Halstead_complexity_measures

Prepare Development setup

  • run npm install inside vscode-allint folder

Debugging both Client and Server

Debugging the client code is as easy as debugging a normal extension. Set a breakpoint in the client code and debug the extension by pressing F5. For a detailed description about launching and debugging an extension see Running and Debugging Your Extension.

Since the server is started by the LanguageClient running in the extension (client), we need to attach a debugger to the running server. To do so, switch to the Debug viewlet and select the launch configuration Attach to Server and press F5. This will attach the debugger to the server.

More Details: https://code.visualstudio.com/docs/extensions/example-language-server#_debugging-both-client-and-server

Known Issues

Next up is the refactoring command and then uploading the summary to a report

Release Notes

0.1.7

Fixes on maintainability index and cycolomatic complexity

0.1.6

Code comments are now excluded from processing.

0.1.4

Some refactoring. Added a check on function length. By default any function longer then 40 lines will be warned.

0.1.3

Fixed a number of issues reported on GitHub.

Check on underscore in variables

0.1.2

First version of refactoring is implemented. The function is always called "foo" and does not yet check if the selection makes sense or depends on variables. Fixed issue with system variables Rec and xRec not being recognised as Hungarian Notation. Added fields to the model with Hungarian Notation check. Check for using WITH statement in Tables and Pages. Warning if local and local variables have the same name. Text Constants throw warning if they have the old notation (TextXXX). Temporary Table Variables must have TEMP, BUFFER, ARGS or ARGUMENTS in the name. Check for reserved words, e.g. a function name called "Action" or a field called "SetRange". Complex Type variables that are declared with object id instead of name give warning. Cleaned up the Type Script a bit here and there.

WARNING: You can not yet disable the new features.

0.1.1

Implemented setting and fixed reported issues.

0.1.0

First version

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.