pana_to_junit 1.0.0

  • Readme
  • Changelog
  • Installing
  • 48

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:


dependencies:
  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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Dec 10, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

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.

Format bin/main.dart.

Run dartfmt to format bin/main.dart.

Format lib/pana_to_junit.dart.

Run dartfmt to format lib/pana_to_junit.dart.

Format lib/src/pana_file_parser.dart.

Run dartfmt to format lib/src/pana_file_parser.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/README.md.

For more information see the pub package layout conventions.

Dependencies

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.1+4
path ^1.6.0 1.6.4
testreport ^1.0.0 1.1.0
Transitive dependencies
analyzer 0.38.5 0.39.2+1
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+2
http_parser 3.1.3
intl 0.16.0
io 0.3.3
js 0.6.1+1
json_annotation 3.0.0
kernel 0.3.27 0.3.29
logging 0.11.3+2
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 2.4.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.5.5
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.6.1
yaml 2.2.0
Dev dependencies
pedantic ^1.7.0 1.9.0
test ^1.5.0