All Projects → rdgd → twly

rdgd / twly

Licence: other
Wanna get DRY? Static analysis tool for detecting repeat code.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to twly

OpenStaticAnalyzer
OpenStaticAnalyzer is a source code analyzer tool, which can perform deep static analysis of the source code of complex systems.
Stars: ✭ 19 (-54.76%)
Mutual labels:  static-analysis, duplicate-detection
scrapman
Retrieve real (with Javascript executed) HTML code from an URL, ultra fast and supports multiple parallel loading of webs
Stars: ✭ 21 (-50%)
Mutual labels:  javascript-tools
jitana
A graph-based static-dynamic hybrid DEX code analysis tool
Stars: ✭ 35 (-16.67%)
Mutual labels:  static-analysis
Awesome-Javascript
A Curated list of Awesome JavaScript Resources
Stars: ✭ 116 (+176.19%)
Mutual labels:  javascript-tools
OCCAM
OCCAM: Object Culling and Concretization for Assurance Maximization
Stars: ✭ 20 (-52.38%)
Mutual labels:  static-analysis
unimport
unimport is a Go static analysis tool to find unnecessary import aliases.
Stars: ✭ 64 (+52.38%)
Mutual labels:  static-analysis
awesome-malware-analysis
Defund the Police.
Stars: ✭ 9,181 (+21759.52%)
Mutual labels:  static-analysis
intercept
INTERCEPT / Policy as Code Static Analysis Auditing / SAST
Stars: ✭ 54 (+28.57%)
Mutual labels:  static-analysis
crud-json-api
Build advanced JSON API Servers with almost no code.
Stars: ✭ 47 (+11.9%)
Mutual labels:  dry
deps-infer
Infer mvn deps from sources
Stars: ✭ 36 (-14.29%)
Mutual labels:  static-analysis
rstatic
An R package for static analysis of R code.
Stars: ✭ 32 (-23.81%)
Mutual labels:  static-analysis
sonarlint4netbeans
SonarLint integration for Apache Netbeans
Stars: ✭ 23 (-45.24%)
Mutual labels:  static-analysis
phpstan.el
Interface to PHPStan (PHP static analyzer)
Stars: ✭ 22 (-47.62%)
Mutual labels:  static-analysis
sonar-scala
A free and open-source SonarQube plugin for static code analysis of Scala projects.
Stars: ✭ 113 (+169.05%)
Mutual labels:  static-analysis
eslint-plugin-vue-scoped-css
ESLint plugin for Scoped CSS in Vue.js
Stars: ✭ 58 (+38.1%)
Mutual labels:  static-analysis
mllint
`mllint` is a command-line utility to evaluate the technical quality of Python Machine Learning (ML) projects by means of static analysis of the project's repository.
Stars: ✭ 67 (+59.52%)
Mutual labels:  static-analysis
yadf
Yet Another Dupes Finder
Stars: ✭ 32 (-23.81%)
Mutual labels:  duplicate-detection
go-mnd
Magic number detector for Go.
Stars: ✭ 153 (+264.29%)
Mutual labels:  static-analysis
save
Universal test framework for cli tools [mainly for code analyzers and compilers]
Stars: ✭ 33 (-21.43%)
Mutual labels:  static-analysis
PhpCodeAnalyzer
PhpCodeAnalyzer scans codebase and analyzes which non-built-in php extensions used
Stars: ✭ 91 (+116.67%)
Mutual labels:  static-analysis
You're a towel

twly?

twly (pronounced "towel-E") is a static analysis tool which can help you keep your code DRY (Don't Repeat Yourself) by letting you know where you have copy and pasted entire files or portions of them. Run twly on a directory, and twly will magically generate a report for you indicating what has been repeated and in which files. twly is language agnostic and can be used on any text document.

Installation

npm install -g twly or to include in some project npm install twly --save-dev

Configuration

twly has some default configuration, which translates into following configuration JSON object

  {
    "threshold": 95,
    "ignore": ["node_modules/**/*.*", "bower_components/**/*.*", ".git/**/*.*"],
    "minLines": 4,
    "minChars": 100
  }

twly reads the config file .trc. This file should contain a JSON object. For example, below is an example .trc file if you wanted to do the following:

  • Ignore the specific files foo.txt and bar.txt as well as all of the content in your node_modules directory
  • Exit with a status code of 1 (failure) if under 89.5 percent of files are unique
  • Only match blocks of code that have are at least 7 lines large with a minimum of 200 characters
  {
    "threshold": 89.5,
    "ignore": ["foo.txt", "bar.txt", "node_modules/**"],
    "minLines": 7,
    "minChars": 200
  }

Usage

You can use twly by simply running the command twly. This will analyze all the files and recurse into subdirectories in your current working directory by default. You can also pass twly a glob pattern... If for example you wanted all javascript files in your current directory and all subdirectories: twly '**/*.js'. This will analyze all CSS files in your current working directory twly '*.css'.

For a list of available CLI arguments run command twly --help.

See the node-glob project for options on how to specify files.

Docker Image

A Dockerfile is provided. It can be be used like so:

twly> docker build -t twly .
app> docker run --rm -t -v "$(pwd):/code" -w /code twly
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].