Module: Txray

Defined in:
lib/txray.rb,
lib/txray/cli.rb,
lib/txray/rule.rb,
lib/txray/tail.rb,
lib/txray/error.rb,
lib/txray/config.rb,
lib/txray/catalog.rb,
lib/txray/monitor.rb,
lib/txray/offense.rb,
lib/txray/railtie.rb,
lib/txray/runtime.rb,
lib/txray/scanner.rb,
lib/txray/version.rb,
lib/txray/analyzer.rb,
lib/txray/reporters.rb,
lib/txray/classifier.rb,
lib/txray/source_file.rb,
lib/txray/client_index.rb,
lib/txray/method_index.rb,
lib/txray/node_helpers.rb,
lib/txray/runtime/sink.rb,
lib/txray/watch_command.rb,
lib/txray/reporters/json.rb,
lib/txray/reporters/live.rb,
lib/txray/reporters/text.rb,
lib/txray/reporters/sarif.rb,
lib/txray/reporters/github.rb,
lib/txray/transaction_scope.rb,
lib/txray/runtime/transaction.rb,
lib/generators/txray/install_generator.rb

Defined Under Namespace

Modules: Catalog, Generators, Namespaces, NodeHelpers, Reporters, Rules, Runtime Classes: Analyzer, CLI, Classifier, ClientIndex, Config, Error, Frame, MethodEntry, MethodIndex, Monitor, Offense, Railtie, Result, Rule, Scanner, ScopeFinder, SourceFile, Tail, TransactionScope, WatchCommand

Constant Summary collapse

VERSION =
"0.2.1"

Class Method Summary collapse

Class Method Details

.analyze(code, path: "(string)", config: Config.new) ⇒ Object



31
32
33
34
# File 'lib/txray.rb', line 31

def self.analyze(code, path: "(string)", config: Config.new)
  source = SourceFile.parse(path, code: code) or return []
  Scanner.new(config).analyze([ source ]).sort_by(&:sort_key)
end

.scan(paths = nil, config: Config.load) ⇒ Object



27
28
29
# File 'lib/txray.rb', line 27

def self.scan(paths = nil, config: Config.load)
  Scanner.new(config, paths: paths).run
end