Repository Page

Each repository where the P42 app is installed has its own Repository page. The Repository page contains a detailed breakdown of the refactoring and modernization suggestions specific to the repository.

To view the Repository page:

  1. Log in to P42.ai and click on Repositories.
  2. In the Repositories page, click to select a GitHub repository.
  3. In the Repository page, you will get a quick view of the number of suggestions (if any) from the analysis.

💡  Easily access the Repository page for your most important repositories by creating bookmarks in your favourite web browser.

Elements

Here are the elements you can find in each Repository page:
Repository page

  1. Repository name
    Name of the GitHub repository. For example, UserA/sample-repository-1.

  2. Link to GitHub repository
    Link to the GitHub repository. For example, github.com/UserA/sample-repository-1.

  3. Excluded repository paths
    Brings up the Configure Excluded Paths dialog to configure path exclusions for the selected repository.

  4. Default repository branch
    Indicates the default branch for the repository. For example, the default branch for UserA/sample-repository-1 is the master branch.

  5. Analysis Results
    Provides a quick view of the number of suggestions for each type of analysis for the repository, if enabled. See Analysis Results for more information.

    💡  If you see the "Analysis timed out" status, this means the analysis runtime for the repository has exceeded ten minutes. You can try to resolve this error by excluding large files or folders (e.g. imported third-party libraries) from the analysis. See Repository Page - Path Exclusions on how to do this.

  6. Analysis type
    Clicking on a type of analysis brings you to the Analysis Page.

Path Exclusions

You can configure P42 to exclude specific paths or files in the repository from all codebase analysis and commit checks. By default, P42 adds path exclusions for output folders (e.g. folders containing rendered output files), minimized libraries, and third-party libraries embedded in your codebase.

To configure path exclusions:

  1. Click on the \<N> excluded paths button.
    Click to configure the path exclusions for the repository
  2. In the Configure Excluded Paths dialog box, enter the prefix of the files or directories which you want to exclude for all P42 analysis and checks. Press the Enter key to specify multiple prefixes on multiple rows.
    Configure Excluded Paths dialog box

    📝  For example, specifying docs/ as a path prefix excludes all paths under the docs directory in the repository.

  3. Click Accept to save the changes, otherwise click Cancel to revert to the previous settings.

Analysis Results

Analysis Results is a summary of the code refactoring and modernization suggestions identified by P42 for your GitHub repository during the codebase analysis.

The results from the P42 analysis would include suggestions to:

  1. Use Arrow Functions,
  2. Use let and const to Declare Variables,
  3. Split Multi-Variable Declarations,
  4. Use Template Literals,
  5. Use Spread Syntax (...) instead of '.apply',
  6. Use Default Parameters, and
  7. Use for...of Loop

💡  P42 codebase analysis works best on source files that use code formatters, such as Prettier.

You should review the results and suggestions from the codebase analysis, and proceed to open a pull request for accepted suggestions.

  It is very important to review the accuracy of the P42 suggestions from the codebase analysis before accepting and merging a pull request. It is also recommended to run unit / integration tests post-analysis on the pull request to ensure no breaking changes result from the P42 analysis suggestions.

See Analysis Page for more information.

Quick Navigation