npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bitbucket-codeinsights-reporter

v0.5.0

Published

[![NPM](https://img.shields.io/npm/v/bitbucket-codeinsights-reporter.svg?label=bitbucket-codeinsights-reporter)](https://www.npmjs.com/package/bitbucket-codeinsights-reporter) [![Downloads/week](https://img.shields.io/npm/dw/bitbucket-codeinsights-reporte

Downloads

68

Readme

bitbucket-codeinsights-reporter

NPM Downloads/week License

Install

sf plugins install bitbucket-codeinsights-reporter

What is bitbucket-codeinsights-reporter?

bitbucket-codeinsights-reporter uses the static code analysis results from the Salesforce Code Analyser plugin and then uploads those results as Annotations to a given commit in Bitbucket Server. Those annotations can then be seen in the Diff view of a Pull Request of that commit.

How to use?

First run the scanner, making sure to provide the --normalize-severity flag. Only JSON output is supported. Check source for reference. Example:

sfdx scanner:run --normalize-severity --json --target "classes/myclass.cls" --outfile results.json

Then pass the results.json file on the report-file parameter of the report command.

Note: do not evaluate all of your source files using the scanner, you should only evaluate modified/created components part of the commit. You can use sfdx-git-delta for that in your pipeline for Pull-Requests validation.

Commands

sf bcr codeinsights report

Takes the static code analysis results of SFCA plugin and uploads them to a givem commit in Bitbucket, providing code reviewers additional insights into the code being reviewed.

USAGE
  $ sf bcr codeinsights report --report-file <value> --commit-id <value> --bitbucket-server-url <value>
    --bitbucket-auth-username <value> --bitbucket-auth-password <value> --bitbucket-project-key <value>
    --bitbucket-repository-slug <value> [--json] [--skip-engine-results pmd|eslint|cpd|retire-js]

FLAGS
  --bitbucket-auth-password=<value>    (required) Your Bitbucket Server password. Preferentially, create a new HTTP
                                       Access Token under your profile page and use it instead of your password.
  --bitbucket-auth-username=<value>    (required) Your Bitbucket Server username.
  --bitbucket-project-key=<value>      (required) The project key where the repository exists.
  --bitbucket-repository-slug=<value>  (required) The repository slug identifier.
  --bitbucket-server-url=<value>       (required) Bitbucket server url.
  --commit-id=<value>                  (required) Commit hash where the code insights will be uploaded to in Bitbucket
                                       Server.
  --report-file=<value>...             (required) The SFCA result JSON file with violations normalized. Accepts multiple
                                       files.
  --skip-engine-results=<option>...    [default: ] Engines to not parse from the results flag.
                                       <options: pmd|eslint|cpd|retire-js>

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Takes the static code analysis results of SFCA plugin and uploads them to a givem commit in Bitbucket, providing code
  reviewers additional insights into the code being reviewed.

  SFCA ("Salesforce Code Analyzer") plugin performs static code analysis using popular tools such as PMD, ESLINT,
  RETIRE.Js, and more. This SFDX plugin takes the results of this analysis and uploads them to a specified commit in
  Bitbucket Server. This allows code reviewers to do a better analysis of the code, gaining valuable insights into the
  quality of the code being reviewed.

  Note: Please make sure when running the `sfdx scanner:run` to provide the flag `--normalize-severity`, otherwise
  reported severities in the code insights may not match to the actual severity level.

EXAMPLES
  $ sf bcr codeinsights report \
  --bitbucket-server-url "https://bitbucket.my-org-instance.org" \
  --bitbucket-auth-username "[email protected]" \
  --bitbucket-auth-password "http-access-token-password" \
  --bitbucket-project-key "PRJ" \
  --bitbucket-repository-slug "my-repo" \
  --commit-id "f1eb3eb5710d2396d68987dd571433151714b499" \
  --report-file report-output.json \
  --skip-engine-results "eslint-lwc" \
  --skip-engine-results "retire-js" \