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:
- Log in to P42.ai and click on Repositories.
- In the Repositories page, click to select a GitHub repository.
- 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.
Here are the elements you can find in each Repository page:
Name of the GitHub repository. For example,
Link to GitHub repository
Link to the GitHub repository. For example,
Excluded repository paths
Brings up the Configure Excluded Paths dialog to configure path exclusions for the selected repository.
Default repository branch
Indicates the default branch for the repository. For example, the default bran
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.
Clicking on a type of analysis brings you to the Analysis Page.
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:
- Click on the \<N> excluded paths button.
- 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.
📝 For example, specifying
docs/as a path prefix excludes all paths under the
docsdirectory in the repository.
- Click Accept to save the changes, otherwise click Cancel to revert to the previous settings.
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:
- Use Arrow Functions,
constto Declare Variables,
- Split Multi-Variable Declarations,
- Use Template Literals,
- Use Spread Syntax (...) instead of '.apply',
- Use Default Parameters, and
💡 P42 codebase analysis works best on source files that use code formatters, such as Prettier.
❗ 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.