Skip to content

pvaass/repo-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repo-analyzer

How it works

As a stand-alone application

repo-analyzer https://github.com/pvaass/repo-analyzer

As a library

platform, _ := getPlatforms().ForURI("https://github.com/pvaass/repo-analyzer") 
repository := repository.New(platform, "https://github.com/pvaass/repo-analyzer")

rules := detector.GetRules('/path/to/my/rules')

var results []detectors.Result := analyze.Run(repository, rules)
// type Result struct {
//    Identifier string
//    Score int
// }

Creating your own rules

You can create your own rules by placing a *.json file in the rules/ directory. Supported strategies are:

  • file-exist:

    • Will return a score of 100 when any of the files in the argument list are found
    • args: ["file-1", "file-2", ...]
  • composer#d:

    • Will return a score of 100 when the first argument is found as a composer.json dependency
    "args": [
      "symfony/symfony" // Dependency to find
     ]
  • composer#f:

    • Will return a score of 100 when the requested field matches the value in composer.json
    "args": [
      "name" //field name, 
      "symfony/symfony" //value
     ]
    • Supported field names: name
  • npm#d:

    • Will return a score of 100 when the first argument is found as a npm (package.json) dependency
    "args": [
      "react" // Dependency to find
     ]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages