New post

Encontrar

Article
· Sep 25, 2024 3m read

CodeInspector: Automating Custom Code Validation

Hi everyone,

In this article, I’m excited to introduce CodeInspector, a tool designed to simplify code validation by applying custom rules tailored to your development requirements. Whether you're managing a large codebase or working in an agile environment, CodeInspector helps ensure code quality by offering flexibility and adaptability to specific project needs.

Motivation

The idea behind CodeInspector was to build a tool that is both easy to implement and adaptable to different business contexts. By allowing teams to define their own validation rules, CodeInspector empowers developers to meet specific code quality standards without sacrificing flexibility. Its simplicity ensures that any team member can quickly configure and start using the tool to enforce consistent coding practices.

Features

  • Package and Class Validation: CodeInspector analyzes and validates packages and classes based on predefined custom rules.
  • Detailed Reports: It generates comprehensive issue reports that can be viewed directly in the console or returned as structured JSON for further processing.

First Steps

  1. Installation: The tool is available on the InterSystems Open Exchange as CodeInspector.
  2. Running the Application: Follow the instructions in the README file to build and start the Docker container. The application runs seamlessly inside a Docker container.
  3. Sample and Rules:
    • In the project folder, you'll find a sample directory with an example class.
    • Additionally, in the codeInspector.rules.examples folder, you’ll find two example validation rules:
      • Example Rule 1: Validates if a class does not exist in the environment.
      • Example Rule 2: Validates if a method exceeds 50 lines of code.
  4. Postman Project: The Postman collection for testing the API has been added to the /iris-dev-codeinspector/collectionPostman/CodeInspector.postman_collection.json folder.

Rest API - CodeInspector JSON Report

API Parameters

The API is available at http://localhost:9091/codeinspector/ and accepts the following parameters:

  • namespace: (required) Specifies the namespace in which the validation will be executed.
  • packages: (required) This parameter must include the names of the packages to be analyzed, separated by commas.
  • ignored: Allows you to provide a comma-separated list of package names to be excluded from the validation process.

Postman Collection

You can find the Postman Collection export in the /iris-dev-codeinspector/collectionPostman/ folder. Import CodeInspector.postman_collection.json into Postman to run API tests.

 

Console Report

To run a validation check from the console, open a terminal and execute:

Do ##class(codeInspector.Main).Execute("sample")

This will trigger the sample validation against the specified class and display the results in the console.

 

Thank you for exploring CodeInspector. At the end of the README document, you’ll find some ideas for future improvements, and I’m always open to new suggestions. I look forward to your feedback and any contributions you’d like to make!

3 Comments
Discussion (3)1
Log in or sign up to continue
Article
· Sep 25, 2024 1m read

Same old terminal but in web

We have Webterminal around for quite a while, but it was limited, not all features worked there. There was no shell support or the latest feature as embedded Python support. There are some issues with tools that require programmer mode. Basic Authorization, not as handy as simple login page, where you could have options to add own login page, in case if you would wish to change the way how to login to the application, such as using SSO.

With the original iris terminal, wrapped into a web form, using most used in the web world xterm.js, used in tools like VSCode as well, with some magic from Python, which helped with interprocess tty. We can get the the terminal in the web, in the full capacity.

iTerm

To test how does it work in the web, I've added term routine, which generates some formatting

iTerm

 

Ideas for future

  • Suggestions and Syntax highlighting You may remember one my previous projects, irissqlcli, which provided intellisense and syntax highlighting to a terminal specifically for SQL access. Mine idea is to add the same level of support to an ObjectScript terminal  And this is already as part of this project, as a tool named iterm, unfortunately not finished yet, it's quite tricky to catch the point between when terminal executes something and awaits for some command.
  • Small VSCode look like with terminal Another project, is irislab, which can inject new item in it

Please vote in the current contest if you like this project

38 Comments
Discussion (38)7
Log in or sign up to continue
Question
· Sep 25, 2024

30 days full working test license

Hello,
Can I receive a 30 day full test license?

7 Comments
Discussion (7)3
Log in or sign up to continue
Article
· Sep 25, 2024 1m read

How to promote your idea on InterSystems Ideas

Hi Developers!

We're sure you want your ideas from the Ideas Portal to be implemented, so here are some steps you can take to attract attention to them.

 

To promote your idea, you can:

1. Create a post on the Developer Community about your idea, inviting users to vote for it on the Ideas Portal. For example, @Heloisa Paiva wrote an article "About the idea of Using Python Class Definition Syntax to create IRIS classes" mentioning "use Python Class Definition Syntax to create IRIS classes" by @Sylvain Guilbaud.

  

2. Request the creation of a poll on the Ideas Portal dedicated to the implementation of the idea. @Guillaume Rongier requested such a poll about his idea idea "Dark version of InterSystems Community". 

To request a poll, write a direct message to @Vadim Aniskin.

3. Respond to comments about your idea on the Ideas Portal and on the Developer Community. 

These three steps will attract attention to your idea and increase the odds of its implementation.

Good luck and keep your ideas coming! 

Discussion (0)1
Log in or sign up to continue
Question
· Sep 25, 2024

活动量

请问一下,活动量仪表盘这个界面怎么激活,实例怎么展现?我的服务器展开没有数据,但是是有消息记录的。

1 Comment
Discussion (1)2
Log in or sign up to continue