pana_to_junit 1.0.0

  • Readme
  • Changelog
  • Installing
  • 46

Pana to JUnit #

A dart application to convert pana JSON output to JUnit XML format, for example to be displayed in Jenkins CI.

Example #

# Run Pana on a package, e.g. redis
pub global run pana redis > out.json

# Use Pana to JUnit to convert pana output to JUnit Report
pub global run pana_to_junit --input out.json --output report.xml

Include in Jenkins Workflow #

This repository includes itself in its CI Workflow:

In the Jenkinsfile, have one step where pana is running. Afterwards, convert the output and collect it in a post step.

pipeline {
    stages {
        stage('Test') {
            steps {
                echo 'Check Health'
                sh 'pub run pana --no-warning --source path ${WORKSPACE} > out.json'
                sh 'pub global run pana_to_junit:main --input out.json --output pana-report.xml'


    post {
        always {
            junit 'pana-report.xml'

Depending on the severness of the suggestions, these are displayed by Jenkins BlueOcean as Accepted or failed tests. All tests have passed, as no suggestion is higher rated than bug Not all tests have passed, as one suggestion is a warning

1.0.0 #

  • Initial version

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  pana_to_junit: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:pana_to_junit/pana_to_junit.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.2

Health issues and suggestions

Document public APIs. (-1 points)

5 out of 5 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix bin/main.dart. (-5.84 points)

Analysis of bin/main.dart reported 12 hints, including:

line 13 col 25: Prefer single quotes where they won't require escape sequences.

line 20 col 11: Prefer single quotes where they won't require escape sequences.

line 23 col 3: Omit type annotations for local variables.

line 25 col 3: Omit type annotations for local variables.

line 25 col 37: Prefer single quotes where they won't require escape sequences.

Fix lib/src/pana_file_parser.dart. (-0.50 points)

Analysis of lib/src/pana_file_parser.dart reported 1 hint:

line 10 col 5: Omit type annotations for local variables.

Format lib/pana_to_junit.dart.

Run dartfmt to format lib/pana_to_junit.dart.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (pana).

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and pana_to_junit.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
args ^1.5.2 1.5.2
junitreport ^1.0.0 1.1.0
pana ^0.12.0 0.12.21 0.13.4
path ^1.6.0 1.6.4
testreport ^1.0.0 1.1.0
Transitive dependencies
analyzer 0.38.5 0.39.4
async 2.4.0
charcode 1.1.2
checked_yaml 1.0.2
cli_util 0.1.3+2
collection 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
front_end 0.1.27 0.1.29
glob 1.2.0
html 0.14.0+3
http 0.12.0+4
http_parser 3.1.3
intl 0.16.1
io 0.3.3
js 0.6.1+1
json_annotation 3.0.1
kernel 0.3.27 0.3.29
logging 0.11.4
markdown 2.1.3
matcher 0.12.6
meta 1.1.8
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
petitparser 3.0.0
pool 1.4.0
pub_semver 1.4.2
pubspec_parse 0.1.5
quiver 2.1.2+1
resource 2.1.6
source_span 1.6.0
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+13
xml 3.7.0
yaml 2.2.0
Dev dependencies
pedantic ^1.7.0 1.9.0
test ^1.5.0