Sonarlint-Instant Feedback Selenium,JAVA,Eclipse



Sonarlint helps the developers to identify the issues on the fly when you write the code immediately. It helps to detect the common mistakes and vulnerabilities based on the thousands of rules in various languages such as Java,Javascript,PHP and PHP . It also helps to scan the source code in different IDE’s such as Eclipse IDE,Intellij IDEA,Visual Studio and VS Code. Please find the list of Sonarlint rules from the link mentioned below:

https://rules.sonarsource.com


Vulnerability Examples:

Its a weakness in the code, which can be exploited by an actor to perform unauthorized actions within a computer system.
“public static” fields should be constant:
Noncompliant Code Example:

Compliant Code Example:


Bug Example:

Loops should not be infinite:
Noncompliant Code Example:


Code Smells:

Nothing but the violation of the Fundamental Design Principals.
Tests Should include Assertions:
Noncompliant Code Example:

default Clauses should be last in the Switch Case


Using Sonarlint in Eclipse:


Download the Sonarlint Plugin from the Eclipse Market Place. During the Development of the Code, the Sonarlint highlights the issues in the editor. It also gives the rule description on the the fly.Once the plugin is installed successfully. Open the Eclipse and write a sample program to verify the rules.

Sonarlint-Eclipse Marketplace

Sonarlint-Eclipse Marketplace


Analyze the Java Source Code using Sonarlint:

Sonarlint-Instant Code Scan

Sonarlint-Instant Code Scan


Click on the rule to view the Rule Description
Sonarlint:RuleDescription

Sonarlint:RuleDescription


Enable the rules in Sonarlint:
Navigate to the Window->Preferences->Sonarlint->Rules Configuration to select the rule configuration for different languages.
Sonarlint-Rules

Sonarlint-Rules


SonarlintRules_Enable_Disable

SonarlintRules_Enable_Disable


Conclusion:


Sonarlint plugin in Eclipse enables the Developers to identify the issues early in the Coding phase to fix the issues during the time of development and fix them on the fly with Compliant Solution.

1 comment on “Sonarlint-Instant Feedback Selenium,JAVA,Eclipse

  1. Loreen Irish

    Do you want more people to visit your website? Get tons of people who are ready to buy sent directly to your website. Boost your profits super fast. Start seeing results in as little as 48 hours. To get info reply to: florence3145hod@gmail.com

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *