Skip to content

1devteam/SweepstacX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SweepstacX

npm version CI License: MIT

Code quality scanning tool for JavaScript/TypeScript projects. Detects dead code, unused imports, stale dependencies, and duplicate logic.

Installation

npm install -g sweepstacx

Basic Usage

# Scan your project
sweepstacx scan

# View the report
sweepstacx report

# Generate patches for issues
sweepstacx patch

# Apply patches automatically
sweepstacx patch --apply

Commands

scan

Scan your codebase for issues.

sweepstacx scan [options]

Options:
  --path <path>      Path to scan (default: ".")
  --lang <lang>      Language hint: js, ts (default: "js")
  --config <file>    Config file (.sweeperc.json)

report

Generate or display scan reports.

sweepstacx report [options]

Options:
  --out <base>       Basename for outputs (default: "sweepstacx-report")
  --json             Output JSON to stdout
  --md               Output Markdown to stdout

patch

Generate and optionally apply patches.

sweepstacx patch [options]

Options:
  --apply            Apply generated patches with git apply

check

CI-friendly stats-only mode.

sweepstacx check [options]

Options:
  --path <path>      Path to scan (default: ".")
  --config <file>    Config file (.sweeperc.json)

Additional Commands

  • lint - Run ESLint on your code
  • deps - Analyze dependencies with depcheck
  • dupes - Find duplicate code blocks
  • complexity - Analyze code complexity
  • fuzz - Fuzz test JavaScript files

Configuration

Create a .sweeperc.json in your project root:

{
  "complexity": {
    "maxFunction": 15,
    "maxAverage": 10,
    "minMaintainability": 65
  },
  "duplication": {
    "maxLines": 10,
    "maxPercent": 8
  },
  "deps": {
    "unused": 0,
    "missing": 0
  },
  "ignore": [
    "node_modules/**",
    "dist/**",
    "coverage/**",
    ".git/**"
  ]
}

CI/CD Integration

GitHub Actions

name: Code Quality

on: [pull_request]

jobs:
  quality:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20.x'
      - run: npm install -g sweepstacx
      - run: sweepstacx scan
      - run: sweepstacx check

Development

Prerequisites

  • Node.js >= 18.17
  • npm or pnpm

Setup

git clone https://github.com/1devteam/SweepstacX.git
cd SweepstacX
npm install
npm test

Running Tests

npm test              # Run all tests
npm run test:watch    # Watch mode
npm run lint          # Run linter

License

MIT © 1devteam

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors