All Projects → DXHeroes → dx-scanner

DXHeroes / dx-scanner

Licence: MIT license
CLI tool that allows you to measure quality of a team work and an app based on your source code.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to dx-scanner

knowledge-base-content
Open-source knowledge base covering topics about developer experience.
Stars: ✭ 73 (-7.59%)
Mutual labels:  practices, developer-experience, developerexperience
Bad Commit Message Blocker
Inhibits commits with bad messages from getting merged
Stars: ✭ 48 (-39.24%)
Mutual labels:  best-practices, code-review
software-practice-thoughts
📚 🐣 软件实践文集。主题不限,思考讨论有趣有料就好,包含如 系统的模型分析/量化分析、开源漫游者指南、软件可靠性设计实践…… 🥤
Stars: ✭ 122 (+54.43%)
Mutual labels:  best-practices, code-review
localhost-sonarqube
Analysing source code locally with SonarQube in a Docker environment.
Stars: ✭ 17 (-78.48%)
Mutual labels:  code-review, developer-experience
accessibility-guide
Client friendly accessibility guide
Stars: ✭ 15 (-81.01%)
Mutual labels:  best-practices
Dilettantes-Guide-to-Linting
Setting up ESLint, Prettier, VS Code, and the AirBnB style guide in beautiful harmony.
Stars: ✭ 18 (-77.22%)
Mutual labels:  best-practices
z-pot
project overview tool, used to analyze the amount of code, the number of files, code statistics and so on.
Stars: ✭ 18 (-77.22%)
Mutual labels:  code-review
Husky.Net
Git hooks made easy with Husky.Net internal task runner! 🐶 It brings the dev-dependency concept to the .NET world!
Stars: ✭ 394 (+398.73%)
Mutual labels:  developer-experience
go-interfaces
This repos has lots of Go interface usage and best practice examples
Stars: ✭ 112 (+41.77%)
Mutual labels:  best-practices
common-coding-conventions
A concise and universal guide to clear software design.
Stars: ✭ 306 (+287.34%)
Mutual labels:  best-practices
frontend-tips
Super tiny, quick tips, tricks and best practices of front-end development
Stars: ✭ 511 (+546.84%)
Mutual labels:  best-practices
android-debug-artist
Debug menu for happy android dev
Stars: ✭ 45 (-43.04%)
Mutual labels:  developer-experience
enterprise-angular-seed
Angular CLI based seed application incorporating many best practices typically needed in Enterprise apps.
Stars: ✭ 62 (-21.52%)
Mutual labels:  best-practices
nodejs-integration-tests-best-practices
✅ Beyond the basics of Node.js testing. Including a super-comprehensive best practices list and an example app (April 2022)
Stars: ✭ 2,842 (+3497.47%)
Mutual labels:  best-practices
BackportCpp
Library of backported modern C++ types to work with C++11
Stars: ✭ 53 (-32.91%)
Mutual labels:  best-practices
guides.etalab.gouv.fr
Les guides d'Etalab : bonnes pratiques relatives aux données, algorithmes et codes sources
Stars: ✭ 18 (-77.22%)
Mutual labels:  best-practices
Cookbook
android-ui-testing.github.io/Cookbook/home/
Stars: ✭ 273 (+245.57%)
Mutual labels:  best-practices
abap-best-practice
A list of common principles of clean ABAP development
Stars: ✭ 69 (-12.66%)
Mutual labels:  best-practices
playwright-lighthouse
🎭: Playwright Lighthouse Audit
Stars: ✭ 120 (+51.9%)
Mutual labels:  best-practices
IDEAPractice
Java练习 - Java基础知识,面试题,小demo,长期积累 | intellij idea + maven + tomcat
Stars: ✭ 45 (-43.04%)
Mutual labels:  practices

Tweet

Slack Pipeliner Roadmap

Version Travis (.org) codecov last commit GitHub commit activity Downloads/week GitHub contributors All Contributors NPM TypeScript


What is DX Scanner?

DX Scanner is an open source CLI tool that allows you to “measure” Developer Experience directly based on your source code. DX Scanner recommends practices that can help you with improving your product development. You can fix some problems automatically with just one command.

What language is supported?

Language Supported
JavaScript/TypeScript
Java/Kotlin
Python
Go
PHP
Ruby
Rust
C++ 🚧
C# 🚧
Android 🚧
Swift 🚧

Table of Contents

Which version control system can you use?

Sure you can use GitHub. You can also use GitLab and Bitbucket no matter if it is public or private repo!

examples:

dx-scanner run https://github.com/DXHeroes/dx-scanner

dx-scanner run https://gitlab.com/ubon-refer/smart-refer-api

dx-scanner run https://bitbucket.org/maras333/node-api-with-ts

Getting Started 🏁

Dependencies

Installation

  • with NPM

    npm install -g dx-scanner

  • with Yarn

    yarn global add dx-scanner

Usage

  dx-scanner run [path] [options]

Example:

  dx-scanner run https://github.com/DXHeroes/dx-scanner

Commands

Usage: dx-scanner [command] [options]

Options:
  -V, --version         output the version number
  -l --log              Write a debug and dxs output log to ./dxscanner.log
  -h, --help            display help for command

Commands:
  run [options] [path]  Scan your project for possible DX recommendations
  init                  Initialize DX Scanner configuration
  practices [options]   List all practices id with name and impact
  help [command]        display help for command

Aliases:
  dxs
  dxscanner

Options for dx-scanner run

Usage: dx-scanner run [path] [options]

Scan your project for possible DX recommendations

Options:
  -a --authorization <authorization>  credentials to the repository (in format "token" or "username:token"; can be set as ENV variable DXSCANNER_GIT_SERVICE_TOKEN)
  -t --apiToken <apiToken>            credentials to DX Scanner, can be set as ENV variable DXSCANNER_API_TOKEN
  --apiUrl <apiUrl>                   URL of DX Scanner API, can be set as ENV variable DXSCANNER_API_URL (default: https://provider.dxscanner.io/api/v1)
  --ci                                CI mode (default: false)
  -d --details                        print details in reports
  --fail <impact>                     exits process with code 1 for any non-practicing condition of given level (high|medium|small|hint|off|all) (default: "off")
  --fix                               tries to fix problems automatically (default: false)
  --fixPattern <pattern>              fix only rules with IDs matching the regex
  -j --json                           print report in JSON (default: false)
  --html [path]                       save report in HTML file (default: false, default path: ./report.html)
  -r --recursive                      scan all components recursively in all sub folders (default: false)
  --no-recursive                      disable recursive scan in CI mode
  -h, --help                          output usage information

Examples:
  dx-scanner run
  dx-scanner run ./ --fail=high
  dx-scanner run github.com/DXHeroes/dx-scanner

Auto-fixer

Fix problems detected by DX Scanner automatically.

dx-scanner run [PATH] --fix

This will try to fix all fixable practices which are not being practices yet. If you want to omit a practice from automatic fixing, you can do it in the configuration file (see below).

You can also specify fixPattern flag to fix only a subset of fixable practices.

dx-scanner run [PATH] --fix --fixPattern=lint

Please note, that fixPattern flag overrides fix settings from configuration file. Therefore practices omitted from fixing by configuration file, but included through fixPattern will be fixed.

Configuration ⚙️

Add dxscannerrc.* config file to change default configuration settings. It can be a .json, .yml, or even a dotfile!

You can also run dx-scanner init to initialize config automatically.

Practices

You can switch off practices that you do not want to scan, change their impact level, and even override their default values. To do so, refer to the id of the practice and specify your configuration.

List of All Practices 🔍
Practice Impact Language Independent JavaScript/TypeScript Java/Kotlin Python PHP
Create a Readme File high
Create a Changelog File high
Create a License File medium
Create a Lockfile high
Create a .gitignore high
Write in Typescript medium
Set .gitignore Correctly high
Set Readme File Correctly high
Use Continuous Integration high
Use Docker small
Use .editorconfig small
Format your code automatically small
Use a Linter medium
ESLint Without Errors medium
Use a different linter medium
Use JS Frontend Testing Framework medium
Use JS Frontend Build Tools medium
Use JS Backend Testing Frameworks high
Use a JS Logging Library small
Use Package Management high
Configure Scripts in package.json medium
Update Dependencies of Major Level small
Update Dependencies of Minor and Patch Level high
Do PullRequests medium
Break down large pull requests into smaller ones medium
Solve Pull Requests Continuously medium
Solve Issues Continuously medium
Write Commit Messages by Convention small
Use Mocking Frameworks for Tests small
Use Testing Frameworks high
Use a Java Logging Dependency small
Use Java Class Naming Convention small
Specify Versions of Dependencies high
Store Environment Variables Using .properties Files medium
Use Java Code Styles small
Use Java Logger Configuration Files small
Security vulnerabilities detected high

Possible impact:

high

medium

small

hint

off

Example dxscannerrc.json:

{
    "practices": {
        "JavaScript.GitignoreCorrectlySet": "medium",
        "JavaScript.LoggerUsed": "off",
        "LanguageIndependent.DoesPullRequests": {
          "impact": "small"
        },
        "JavaScript.ESLintWithoutErrorsPractice": {
          "fix": true,
          "override": {
            "lintFilesPatterns": [".internal/**/*.js", "*.js"],
            "ignorePatterns": []
          }
        },
        "LanguageIndependent.ThinPullRequestsPractice": {
          "impact": "high",
          "override": {
            "measurePullRequestCount": 500
          }
        }
    }
}

In order to override the default values of certain practices, specify override and nest the correct overridable variables.

Example dxscannerrc.yaml:

---
practices:
  JavaScript.GitignoreCorrectlySet: medium
  JavaScript.LoggerUsed: 'off'
  LanguageIndependent.DoesPullRequests:
    impact: small
  JavaScript.ESLintWithoutErrorsPractice:
    fix: true
    override:
      lintFilesPatterns: ['.internal/**/*.js', '*.js']
      ignorePatterns: []
  LanguageIndependent.ThinPullRequestsPractice:
    impact: high
    override:
      measurePullRequestCount: 500

CI Mode

When running DX Scanner with --ci flag, it runs in CI Mode. In CI Mode, DX SCanner uses CIReporter for its output and runs recursively by default (i.e. the --recursive flag is turned on).

If you want to disable recursive scan in CI mode, use the --no-recursive flag.

Github CI Action

Basic example: run DX Scanner on each push to the repo

Create .github/workflows/main.yml.

name: DX Scanner
on: push
jobs:
  dx-scanner:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: Runs DX Scanner on the code
        uses: DXHeroes/dx-scanner@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

Generate your Github personal token and set it as an encrypted secret named GITHUB_TOKEN.

Score Computation 💯

The impact of each practice is represented by a specific value. DX Scanner uses these values to calculate the overall DX Score.

high = 100 points

medium = 75 points

small = 50 points

hint = 25 points

The practices you have switched off are not included in the calculation (0 points).

Support 🦸‍♀️ 🦸‍♂️

Didn't you find what you expected? Contact us via our public Slack!

Contributing 👩‍💻 👨‍💻

Feel free to contribute to our DX Scanner. Please follow the Contribution Guide.

Roadmap

See our public roadmap.

License 📝

The DX Scanner open source project is licensed under the MIT.

Contributors

Many thanks to these wonderful people (emoji key):


Prokop Simek

💻 🚧

adelkah

💻 🚧

Radek Holý

💻

Vratislav Kalenda

💻 🤔

Petr Vnenk

💻

Cuong Nguyen

💻

vlasy

💻

This project follows the all-contributors specification. Any kind of contributions are welcome!

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].