Performs a comprehensive analysis of the letter frequency in JavaScript and TypeScript files within the specified GitHub repository. The method executes several steps: fetching the latest commit's SHA, retrieving the repository tree, checking the GitHub API rate limit to ensure the feasibility of the operation, analyzing the letter frequency in .js
and .ts
files, and finally displaying the results.
- Initialize GitHub Client: Set up the GitHub client with necessary credentials.
- Fetch Repository Tree: Retrieve the tree structure of the repository based on the latest commit.
- Rate Limit Check: Ensure that the GitHub API's rate limit is sufficient to process all the JavaScript and TypeScript files in the repository. Throws an exception if the rate limit is insufficient.
- Letter Frequency Analysis: Analyze the frequency of each letter in the contents of
.js
and.ts
files. - Display Results: Sort and display the letter frequency analysis results in descending order.
- Throws a
System.Exception
if the GitHub API rate limit is not sufficient to process all target files.