generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metric of PsiContext for Java and Python #139
Comments
phodal
added a commit
that referenced
this issue
Nov 16, 2024
Related to #139 Add support for metrics in PsiContext. * **PsiContextVariable.kt**: Add new enum constants `CHANGE_COUNT`, `LINE_COUNT`, and `COMPLEXITY_COUNT` with descriptions. * **DefaultPsiContextVariableProvider.kt**: Implement logic to resolve `CHANGE_COUNT`, `LINE_COUNT`, and `COMPLEXITY_COUNT` variables with placeholder values. * **PostProcessorContext.kt**: Add properties `changeCount`, `lineCount`, and `complexityCount` to the `PostProcessorContext` class. * **PostProcessor.kt**: Initialize `changeCount`, `lineCount`, and `complexityCount` in the `setup` method and add a placeholder for finalizing these metrics in the `finish` method. * **PostProcessorType.kt**: Add new enum constants `ChangeCountMetric`, `LineCountMetric`, and `ComplexityMetric`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/phodal/shire/issues/139?shareId=XXXX-XXXX-XXXX-XXXX).
phodal
added a commit
that referenced
this issue
Nov 16, 2024
Related to #139 Add support for metric elements in `PsiContextVariable`. #139 * Add new enum entries `CHANGE_COUNT`, `LINE_COUNT`, and `COMPLEXITY_COUNT` to `PsiContextVariable`. * Implement `changeCount`, `lineCount`, and `complexityCount` functions in `PsiContextVariableProviderImpl`. * Use `Git` API to analyze changes for `changeCount`. * Use `PsiFile` API to count lines for `lineCount`. * Create `ComplexityVisitor` class extending `PsiRecursiveElementVisitor` to analyze complexity for `complexityCount`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/phodal/shire/issues/139?shareId=XXXX-XXXX-XXXX-XXXX).
phodal
added a commit
that referenced
this issue
Nov 16, 2024
Related to #139 Add support for metric elements `changeCount`, `lineCount`, and `complexityCount` in `PsiContextVariable`. * Add `changeCount`, `lineCount`, and `complexityCount` as new variables in `PsiContextVariable` enum in `PsiContextVariable.kt`. * Implement `changeCount`, `lineCount`, and `complexityCount` functions in `DefaultPsiContextVariableProvider.kt`. * Implement `changeCount`, `lineCount`, and `complexityCount` functions in `MarkdownPsiContextVariableProvider.kt`. * Implement `changeCount`, `lineCount`, and `complexityCount` functions in `GoPsiContextVariableProvider.kt`. * Implement `changeCount`, `lineCount`, and `complexityCount` functions in `JavaPsiContextVariableProvider.kt`. * Implement `changeCount`, `lineCount`, and `complexityCount` functions in `JSPsiContextVariableProvider.kt`. * Add tests for `changeCount`, `lineCount`, and `complexityCount` functions in `MarkdownPsiContextVariableProviderTest.kt`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/phodal/shire/issues/139?shareId=XXXX-XXXX-XXXX-XXXX).
phodal
added a commit
that referenced
this issue
Nov 18, 2024
Extract the PsiSyntaxCheckingVisitor from VerifyCodeProcessor to a new standalone file in the ast package. This refactoring promotes code reusability and cleans up the VerifyCodeProcessor by removing the visitor code and now importing it from the new location.
phodal
added a commit
that referenced
this issue
Nov 18, 2024
Add the ability to process a PsiElement to the ComplexityProvider, allowing for more granular complexity calculations.
phodal
added a commit
that referenced
this issue
Nov 18, 2024
…ySink and ComplexityPoint #139 - Modify ComplexityProvider interface to accept a ComplexitySink in the visitor function. - Introduce ComplexitySink class to track and manage complexity points and nesting levels. - Add ComplexityPoint data class to represent individual complexity points with their types.
phodal
added a commit
that referenced
this issue
Nov 18, 2024
Updated the qualified name of the complexity provider extension point to reflect a more specific naming convention. Implemented a new Java complexity provider and its corresponding visitor to calculate code complexity for Java language files.
phodal
added a commit
that referenced
this issue
Nov 18, 2024
…vider #139 The commit updates the `JavaComplexityProvider` to accurately calculate complexity by accepting a visitor and using a `ComplexitySink`. Additionally, it introduces a test case `JavaComplexityProviderTest` to verify the complexity calculation for a given Java code snippet.
phodal
added a commit
that referenced
this issue
Nov 18, 2024
phodal
added a commit
that referenced
this issue
Nov 18, 2024
…eProvider #139 Previously, the complexity count for PsiVariableProvider was not calculated and returned an empty string. Now, the complexity count is properly calculated for each PsiVariableProvider implementation across different languages.
phodal
added a commit
that referenced
this issue
Nov 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
Support for metric element metric, add to
PsiContextVariable.kt
Describe alternatives you've considered
Similar project: https://github.com/nikolaikopernik/code-complexity-plugin
Additional context
implementation simple
changeCount
,lineCount
,complexityCount
function inPsiContextVariableProvider
changeCount
analysis currentpsiElement.containingFile
git changelineCount
count current containingFile lengthcomplexityCount
create a new interface like (ComplexityProvider
) to analysis complexity, create visitor to visit element, like:ElementVisitor example
The text was updated successfully, but these errors were encountered: