Output Checkstyle XML reports.
191655
def stop(self):
        """"""
        et = ET.ElementTree(self.checkstyle_element)
        f = BytesIO()
        et.write(f, encoding='utf-8', xml_declaration=True)
        xml = f.getvalue().decode('utf-8')
        if self.output_fd is None:
            print(xml)
        else:
            self.output_fd.write(xml)
        super(CheckstylePlugin, self).stop()
614242
def start_output (self):
        
        super(CustomXMLLogger, self).start_output()
        self.xml_start_output()
        attrs = {"created": strformat.strtime(self.starttime)}
        self.xml_starttag(u'linkchecker', attrs)
        self.flush()
503806
private void prettyprint(String xmlLogsFile, FileOutputStream htmlReportFile)
            throws Exception {
        TransformerFactory tFactory = TransformerFactory.newInstance();
        // Fortify Mod: prevent external entity injection
        tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        // Fortify Mod: prevent external entity injection
        factory.setExpandEntityReferences(false);
        factory.setNamespaceAware(true);
        factory.setXIncludeAware(true);
        DocumentBuilder parser = factory.newDocumentBuilder();
        Document document = parser.parse(xmlLogsFile);
        Transformer transformer = tFactory.newTransformer(new StreamSource(
                xsltFileHandler));
        transformer.transform(new DOMSource(document), new StreamResult(
                htmlReportFile));
    }
603555
def main():
    """"""

    reporter = BugReporter()

    print("JSON report:")
    print(reporter.as_json())
    print()

    print("Markdown report:")
    print(reporter.as_markdown())

    print("SQL report:")
    print(reporter.as_sql())

    print("Choose the appropriate format (if you're submitting a Github Issue "
          "please chose the Markdown report) and paste it!")
38731
public static String reportToXml(Report report) {
		XStream xstream = XStreamFactory.createXStream();
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		xstream.toXML(report, bos);
		return bos.toString();
	}
655578
def dump(self, stream):
        
        if self.prettyprint:
            self.indent(self.xml)
        document = etree.ElementTree(self.xml)
        header = '<?xml version="1.0" encoding="%s"?>' % self.encoding
        stream.write(header.encode(self.encoding))
        document.write(stream, encoding=self.encoding)
1077301
def html_report(self, file_path):
        """"""
        self.logger.debug('Generating HTML report')
        report = self.zap.core.htmlreport()
        self._write_report(report, file_path)
702423
def output(self):
        """"""
        print(copyright_header % spec_version)
        self._output_imports()
        self._output_tags()
        self._output_validators()
        header = self.override.get_header()
        if header:
            print()
            print()
            print(header.rstrip())

        seen = {}
        for class_name, properties in sorted(self.resources.items()):
            resource_name = self.resource_names[class_name]
            t = self.build_tree(class_name, properties, resource_name)
            self.output_tree(t, seen)
1148373
function checkStylesheet(i) {
  const start = i;
  let l;

  while (i < tokensLength) {
    if (l = checkSC(i)) tokens[i].stylesheet_child = 1;
    else if (l = checkRuleset(i)) tokens[i].stylesheet_child = 2;
    else if (l = checkInclude(i)) tokens[i].stylesheet_child = 3;
    else if (l = checkExtend(i)) tokens[i].stylesheet_child = 4;
    else if (l = checkMixin(i)) tokens[i].stylesheet_child = 5;
    else if (l = checkLoop(i)) tokens[i].stylesheet_child = 6;
    else if (l = checkConditionalStatement(i)) tokens[i].stylesheet_child = 7;
    else if (l = checkAtrule(i)) tokens[i].stylesheet_child = 8;
    else if (l = checkDeclaration(i)) tokens[i].stylesheet_child = 9;
    else if (l = checkDeclDelim(i)) tokens[i].stylesheet_child = 10;
    else throwError(i);

    i += l;
  }

  return i - start;
}
685680
def qa(ctx):
    ''''''
    header(qa.__doc__)
    with ctx.cd(ROOT):
        info('Python Static Analysis')
        flake8_results = ctx.run('flake8 bumpr', pty=True, warn=True)
        if flake8_results.failed:
            error('There is some lints to fix')
        else:
            success('No lint to fix')
        info('Ensure PyPI can render README and CHANGELOG')
        readme_results = ctx.run('python setup.py check -r -s', pty=True, warn=True, hide=True)
        if readme_results.failed:
            print(readme_results.stdout)
            error('README and/or CHANGELOG is not renderable by PyPI')
        else:
            success('README and CHANGELOG are renderable by PyPI')
    if flake8_results.failed or readme_results.failed:
        exit('Quality check failed', flake8_results.return_code or readme_results.return_code)
    success('Quality check OK')
930847
private final void fixReportCheckstyle(final Element root) {
        final Collection<Element> elements; // Found elements

        elements = root.getElementsByTag("h2");
        if (!elements.isEmpty()) {
            elements.iterator().next().tagName("h1");
        }
        root.select("img[src=\"images/rss.png\"]").remove();
    }
1116319
def savePattern(self):
        
        if ( self.dev == None ): return ''
        buf = [REPORT_ID, ord('W'), 0xBE, 0xEF, 0xCA, 0xFE, 0, 0, 0]
        return self.write(buf);
1353120
def write_xml(self, as_string=False):
        """"""
        if not as_string:
            et.ElementTree(self.xmlreport).write('{}/{}.xml'.format(self.outpath, self.outputprefix), pretty_print=True, xml_declaration=True)
        else:
            output = et.tostring(self.xmlreport, pretty_print=True)
            if config.RAWSTRING:
                output = repr(output)
            print(output)
110463
def pp_xml(body):
    """"""
    pretty = xml.dom.minidom.parseString(body)
    return pretty.toprettyxml(indent="  ")
1305545
public void generateReport(List<XmlSuite> xmlSuites,
                               List<ISuite> suites,
                               String outputDirectoryName)
    {
        removeEmptyDirectories(new File(outputDirectoryName));
        
        boolean useFrames = System.getProperty(FRAMES_PROPERTY, "true").equals("true");
        boolean onlyFailures = System.getProperty(ONLY_FAILURES_PROPERTY, "false").equals("true");

        File outputDirectory = new File(outputDirectoryName, REPORT_DIRECTORY);
        outputDirectory.mkdirs();

        try
        {
            if (useFrames)
            {
                createFrameset(outputDirectory);
            }
            createOverview(suites, outputDirectory, !useFrames, onlyFailures);
            createSuiteList(suites, outputDirectory, onlyFailures);
            createGroups(suites, outputDirectory);
            createResults(suites, outputDirectory, onlyFailures);
            createLog(outputDirectory, onlyFailures);
            copyResources(outputDirectory);
        }
        catch (Exception ex)
        {
            throw new ReportNGException("Failed generating HTML report.", ex);
        }
    }
335607
public void reportSummary(@WillClose OutputStream out) throws IOException {
        XMLOutput xmlOutput = new OutputStreamXMLOutput(out);
        try {
            writeXML(xmlOutput);
        } finally {
            xmlOutput.finish();
        }
    }
343847
function buildScriptsAndStyleFiles(outputPath) {
	const stylesRegex = /<style>|<\/style>/gi,
		scriptsRegex = /<script type="text\/javascript">|<\/script>/gi;

	// creates the report directory if it doesn't exist
	if (!fs.existsSync(outputPath)) {
		fs.mkdirSync(outputPath);
	}

	// create the styles.css and main.js files
	writeFile(`${outputPath}styles.css`, styles(), stylesRegex);
	writeFile(`${outputPath}main.js`, scripts(), scriptsRegex);
}