Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

violation-reporter

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

violation-reporter

Genrate violation reports in various formats

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Synopsis

Generate a generic violation report from whatever tool you like and optionally generate a standard XML report.

Code Example

var MultiReporter = require('violation-reporter')(grunt);
var XMLReporter = require('violation-reporter/tasks/XML')(grunt);
var checkstyleReporter = require('violation-reporter/tasks/checkstyleXML')(grunt, XMLReporter);

// create a new reporter and add checkstyle formatting
var reporter = new MultiReporter(files, options);
reporter.addReporter(checkstyleReporter);

// create a new violation, from whatever data you like
violations.push({
  filepath: file,
  line: 0,
  column: 0,
  name: key,
  rule: key,
  severity: severity,
  message: 'Too many',
  ratio: ratio,
  value: metrics[key] + ' ('+ options.analyzecss[key] + ')'
});

// register the violation with the reporter
reporter.violations(file, violations); 
   

Real-world examples can be found in (grunt-css-analysis) and (grunt-complexity-report)

Motivation

Jenkins has plugins to report on violations from a number of standard tools. There are many tools that are used to generate errors and issues, in a huge range of formats. Violation-reporter is designed as a way to take this data and transform it into one of the available standards. Generally intended to be run from grunt or another build tool.

It currently only outputs to console, checkstyle and PMD format, but would be easy to extend to other XML formats.

Installation

npm install violation-reporter

Contributors

Stuart Campbell (campbes)

License

Released under the MIT License

FAQs

Package last updated on 10 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc