Git Product home page Git Product logo

uncleancode-sonar-plugin's Introduction

Unclean Code Sonar Plugin

The unclean code sonar plugin aims to capture complex code, metrics of design and architectural level. Provides a guided way for the developers to improve code quality. Inspired by the book clean code by Robert Martin (Uncle Bob).

Seven Axes of Quality

It aims to cover the last two axes.

  1. Potential bugs
  2. Coding rules
  3. Tests
  4. Duplications
  5. Comments
  6. Architecture and design
  7. Complexity

How to use this in local sonar server

Download the jar here and copy into the SONAR_INSTALLED_PATH\extensions\plugins and restart the sonar server. If you dont have local setup of sonar, follow the instruction and setup local sonar.

How to use this in sonar quality profile

Login to your sonar server: http://localhost:9000. Search for rule repository with the uncleancode, it will list down all the rules bundled in this plugin. Then, you can add rules under the appropriate quality profile.

Few code smell and rules

AvoidPublicBooleanParameterRule - It enforces SRP. If a public method has a boolean parameter, which means the method is performing more than one responsibility.

AvoidMultipleParameterRule - To keep the API definition simple and concise, avoid using more than two parameters.

AvoidNullCheckInPrivateMethodRule - It enforces SRP by identifying the null checking inside the private method. This leads to more than one responsibility, similar to boolean input parameter, if-else branch with null and non-null value. It avoids defensive way of programming with lot of null-checks inside any private methods. The validity of the input parameters should have been done in the public methods.

PrivateMethodPositionRule - It improves readability of a class, push all the private methods to the bottom of the class and keep the public methods at the top. Anyone who reads the class would be interested in public methods initially, also the tiny private methods can be mostly understandable by its name.

there are more to add..,

uncleancode-sonar-plugin's People

Contributors

senthilaru avatar spsenthil-cdk avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

flowerinwater

uncleancode-sonar-plugin's Issues

Efferent coupling of a class

No. of dependent class used in X class, should be less than 6. (OO Metrics and Rules of Thumb Recommended by Lorenz)
(OR)
Fan-out: A count of modules that are called by a given module (proposed by Yourdon and Constantine (1979) and Myers (1978))

Package cycle

Class A in package-1 depends on Class-B in package-2.
And
Anyother class in package-2 depends on any class in package-1

Afferent Coupling of a class

No. of classes uses the X class
(OR)
Fan-in: A count of the modules that call a given module (proposed by Yourdon and Constantine (1979) and Myers (1978))

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.