All Projects → racodond → sonar-gherkin-plugin

racodond / sonar-gherkin-plugin

Licence: LGPL-3.0 License
SonarQube Cucumber Gherkin Analyzer

Programming Languages

java
68154 projects - #9 most used programming language
Gherkin
971 projects
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to sonar-gherkin-plugin

sonar-css-plugin
SonarQube CSS / SCSS / Less Analyzer
Stars: ✭ 46 (+39.39%)
Mutual labels:  styleguide, linter, static-analysis, sonarqube, code-quality, static-analyzer, guidelines, sonarqube-plugin
Sonar Jproperties Plugin
SonarQube Java Properties Analyzer
Stars: ✭ 5 (-84.85%)
Mutual labels:  styleguide, linter, static-analysis, sonarqube, code-quality, static-analyzer, guidelines
Pep8speaks
A GitHub app to automatically review Python code style over Pull Requests
Stars: ✭ 546 (+1554.55%)
Mutual labels:  styleguide, linter, static-analysis, code-quality
Sonar Dotnet
Code analyzer for C# and VB.NET projects https://redirect.sonarsource.com/plugins/vbnet.html
Stars: ✭ 466 (+1312.12%)
Mutual labels:  static-analysis, sonarqube, code-quality, static-analyzer
Sonarts
Static code analyzer for TypeScript
Stars: ✭ 776 (+2251.52%)
Mutual labels:  linter, static-analysis, sonarqube, code-quality
Sonarjs
SonarSource Static Analyzer for JavaScript and TypeScript
Stars: ✭ 696 (+2009.09%)
Mutual labels:  static-analysis, sonarqube, code-quality, static-analyzer
Cuke linter
A linting tool for Cucumber
Stars: ✭ 24 (-27.27%)
Mutual labels:  linter, gherkin, cucumber
Static Analysis
⚙️ A curated list of static analysis (SAST) tools for all programming languages, config files, build tools, and more.
Stars: ✭ 9,310 (+28112.12%)
Mutual labels:  linter, static-analysis, code-quality
Cflint
Static code analysis for CFML (a linter)
Stars: ✭ 156 (+372.73%)
Mutual labels:  linter, static-analysis, code-quality
Pmd
An extensible multilanguage static code analyzer.
Stars: ✭ 3,667 (+11012.12%)
Mutual labels:  linter, static-analysis, code-quality
sonarqube-action
Integrate SonarQube scanner to GitHub Actions
Stars: ✭ 90 (+172.73%)
Mutual labels:  static-analysis, sonarqube, code-quality
Flake8
The official GitHub mirror of https://gitlab.com/pycqa/flake8
Stars: ✭ 1,112 (+3269.7%)
Mutual labels:  styleguide, linter, static-analysis
Sonar Kotlin
SonarQube plugin for Kotlin
Stars: ✭ 412 (+1148.48%)
Mutual labels:  linter, sonarqube, code-quality
Njsscan
njsscan is a semantic aware SAST tool that can find insecure code patterns in your Node.js applications.
Stars: ✭ 128 (+287.88%)
Mutual labels:  linter, static-analysis, static-analyzer
Detekt
Static code analysis for Kotlin
Stars: ✭ 4,169 (+12533.33%)
Mutual labels:  linter, static-analysis, code-quality
localhost-sonarqube
Analysing source code locally with SonarQube in a Docker environment.
Stars: ✭ 17 (-48.48%)
Mutual labels:  static-analysis, sonarqube, code-quality
tryceratops
A linter to prevent exception handling antipatterns in Python (limited only for those who like dinosaurs).
Stars: ✭ 381 (+1054.55%)
Mutual labels:  styleguide, linter, static-analysis
lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-57.58%)
Mutual labels:  linter, static-analysis, static-analyzer
Reviewdog
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language
Stars: ✭ 4,541 (+13660.61%)
Mutual labels:  linter, static-analysis, code-quality
Pylint
It's not just a linter that annoys you!
Stars: ✭ 3,733 (+11212.12%)
Mutual labels:  linter, static-analysis, code-quality

Release Build Status AppVeyor Build Status

Quality Gate status Lines of Code Coverage

SonarQube Cucumber Gherkin Analyzer

Disclaimer

I don't want to keep maintaining this plugin. Feel free to ping me if you want to take over.

Description

This SonarQube plugin analyzes Cucumber Gherkin feature files and:

  • Computes metrics: lines of code, number of scenarios, etc.
  • Checks various guidelines to find out potential bugs and code smells through more than 40 checks
  • Provides the ability to write your own checks

Usage

  1. Download and install SonarQube
  2. Install the Cucumber Gherkin plugin by a direct download. The latest version is compatible with SonarQube 6.7+.
  3. Install your favorite scanner (SonarQube Scanner, Maven, Ant, etc.)
  4. Analyze your code

Maven

It is likely that your feature files are not located in source code directories but in test directories. By default, SonarQube doesn't analyze those test directories. Thus, you have to explicitly tell SonarQube to also analyze the test directories containing your feature files.

Let's say that the structure of your project is:

pom.xml
src
  |-- main
        |-- java
        |-- resources
  |-- test
        |-- java
        |-- resources
              |-- features
                    |-- my-feature.feature
                    |-- my-other-feature.feature
                                   
                

In you POM file, you would need to add:

<properties>
  <sonar.sources>pom.xml,src/main/java,src/main/resources,src/test/resources/features</sonar.sources>
</properties>  

Custom Checks

You're thinking of new valuable rules? Version 1.0 or greater provides an API to write your own custom checks. A sample plugin with detailed explanations is available here. If your custom rules may benefit the community, feel free to create a pull request in order to make the rule available in the Cucumber Gherkin analyzer.

You're thinking of new rules that may benefit the community but don't have the time or the skills to write them? Feel free to create an issue for your rules to be taken under consideration.

Metrics

Statements

Number of steps.

Functions

Number of scenarios and scenario outlines.

Classes

Number of features.

Available Rules

  • "FIXME" tags should be handled
  • "TODO" tags should be handled
  • All comments should be formatted consistently
  • And and But prefixes should be used instead of redundant Given/When/Then prefixes
  • Byte Order Mark (BOM) should not be used for UTF-8 files
  • Common Given steps should be added to Background
  • Duplicated steps should be removed
  • End-line characters should be consistent
  • Examples data tables should contain data at least two data rows
  • Features should be written in the same language
  • Features should have a description
  • Features should have a name
  • Features should have a unique name
  • Features should not contain too many scenarios
  • Features that do not define any scenario should be removed
  • File names should comply with a naming convention
  • Files should contain an empty new line at the end
  • Files that do not define any feature should be removed
  • Given steps should follow a regular expression
  • Given/When/Then steps should be defined in the right order
  • Lines should not end with trailing whitespaces
  • Missing data table columns should be added
  • Non-Given steps should be moved out of Background
  • Only tags from the whitelist should be used
  • Regular expression on comment
  • Scenarios should define at least one of each Given/When/Then step type
  • Scenarios should have a name
  • Scenarios should have a unique name
  • Scenarios should not contain too many steps
  • Scenarios that do not define any step should be removed
  • Source code should be properly indented
  • Spelling mistakes should be fixed
  • Star (*) step prefixes should not be used
  • Step sentences should not be too long
  • Steps of unknown type should not be used
  • Tabulation characters should not be used
  • Tags should be defined at the right level
  • Tags should comply with a naming convention
  • Tags should not be set on Examples
  • Then steps should follow a regular expression
  • There should be one single When step per scenario
  • Unused variables should be removed
  • Useless tags should be removed
  • When steps should follow a regular expression
  • Wording should remain at business level
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].