isselab / HAnS

HAnS - Helping Annotate Software. HAnS is an open-source (Apache 2.0) plugin for IntelliJ that helps you annotate software.
Apache License 2.0
6 stars 8 forks source link

Clone Management #67

Open Ahmad-sh7 opened 6 months ago

Ahmad-sh7 commented 6 months ago

Description

I developed a clone management tool without making any major changes to in HAnS. The tool is based on the clone principles of the virtual platform and is designed to track not only the clones of software assets but also all features annotated or assigned to these assets.

Related Issue

66

Motivation and Context

Having a tool to manage software clones is critical for several reasons. First, clones contribute to code bloat, complicating the code base and making maintenance more difficult. Second, clones can lead to increased maintenance costs because changes must be replicated across all cloned instances to maintain consistency. Finally, clones present a risk of bug propagation; if a bug exists in one cloned segment, it is likely to be present in all its copies.

How Has This Been Tested?

I implemented a series of unit tests to check the functionality of methods that are independent of plugin components. For the implementation of the integration tests, I created several test scenarios using a simulation project provided by test frameworks such as 'BasePlatformTestCase’ and ‘LightPlatformCodeInsightTestCase’. Most of the integration tests still only pass in debug-mode.

Screenshots (if appropriate):

Types of changes

Checklist:

github-actions[bot] commented 6 months ago

Qodana Community for JVM

254 new problems were found

Inspection name Severity Problems
@NotNull/@Nullable problems 🔶 Warning 34
Duplicate character in character class 🔶 Warning 22
Unused assignment 🔶 Warning 21
C-style array declaration 🔶 Warning 20
Nullability and data flow problems 🔶 Warning 20
Field can be local 🔶 Warning 16
Unused import 🔶 Warning 13
Redundant local variable 🔶 Warning 12
Redundant nested character class 🔶 Warning 6
Incorrect string capitalization 🔶 Warning 5
Field may be 'final' 🔶 Warning 5
Loop variable not updated inside loop 🔶 Warning 5
Unnecessary unicode escape sequence 🔶 Warning 5
Unstable API Usage 🔶 Warning 5
Deprecated API usage 🔶 Warning 3
Labeled switch rule has redundant code block 🔶 Warning 3
'size() == 0' can be replaced with 'isEmpty()' 🔶 Warning 3
Call to 'printStackTrace()' 🔶 Warning 3
Redundant character escape 🔶 Warning 2
Unnecessarily escaped character 🔶 Warning 2
Constant values 🔶 Warning 1
Dangling Javadoc comment 🔶 Warning 1
Pointless bitwise expression 🔶 Warning 1
Replacement operation has no effect 🔶 Warning 1
'String.equals()' can be replaced with 'String.isEmpty()' 🔶 Warning 1
Unnecessary 'return' statement 🔶 Warning 1
Unnecessary semicolon 🔶 Warning 1
Bulk operation can be used instead of iteration 🔶 Warning 1
Duplicate branches in 'switch' ◽️ Notice 36
Commented out code ◽️ Notice 2
Method can be extracted ◽️ Notice 2
'if' statement with identical branches ◽️ Notice 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report To be able to view the detailed Qodana report, you can either: 1. Register at [Qodana Cloud](https://qodana.cloud/) and [configure the action](https://github.com/jetbrains/qodana-action#qodana-cloud) 2. Use [GitHub Code Scanning with Qodana](https://github.com/jetbrains/qodana-action#github-code-scanning) 3. Host [Qodana report at GitHub Pages](https://github.com/JetBrains/qodana-action/blob/3a8e25f5caad8d8b01c1435f1ef7b19fe8b039a0/README.md#github-pages) 4. Inspect and use `qodana.sarif.json` (see [the Qodana SARIF format](https://www.jetbrains.com/help/qodana/qodana-sarif-output.html#Report+structure) for details) To get `*.log` files or any other Qodana artifacts, run the action with `upload-result` option set to `true`, so that the action will upload the files as the job artifacts: ```yaml - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2023.3.1 with: upload-result: true ```
Contact Qodana team Contact us at [qodana-support@jetbrains.com](mailto:qodana-support@jetbrains.com) - Or via our issue tracker: https://jb.gg/qodana-issue - Or share your feedback: https://jb.gg/qodana-discussions
github-actions[bot] commented 2 months ago

Qodana Community for JVM

41 new problems were found

Inspection name Severity Problems
Unused import 🔶 Warning 9
Nullability and data flow problems 🔶 Warning 8
Incorrect string capitalization 🔶 Warning 4
Deprecated API usage 🔶 Warning 3
@NotNull/@Nullable problems 🔶 Warning 2
Redundant character escape 🔶 Warning 2
Call to 'printStackTrace()' 🔶 Warning 2
Constant values 🔶 Warning 1
Dangling Javadoc comment 🔶 Warning 1
Field can be local 🔶 Warning 1
Redundant local variable 🔶 Warning 1
Unnecessary call to 'toString()' 🔶 Warning 1
Unused assignment 🔶 Warning 1
Bulk operation can be used instead of iteration 🔶 Warning 1
Commented out code ◽️ Notice 2
Method can be extracted ◽️ Notice 2

💡 Qodana analysis was run in the pull request mode: only the changed files were checked ☁️ View the detailed Qodana report

Contact Qodana team Contact us at [qodana-support@jetbrains.com](mailto:qodana-support@jetbrains.com) - Or via our issue tracker: https://jb.gg/qodana-issue - Or share your feedback: https://jb.gg/qodana-discussions
github-actions[bot] commented 2 months ago

Qodana Community for JVM

53 new problems were found

Inspection name Severity Problems
Usage of API marked for removal 🔴 Failure 7
Unused import 🔶 Warning 10
Nullability and data flow problems 🔶 Warning 8
Incorrect string capitalization 🔶 Warning 4
Deprecated API usage 🔶 Warning 3
@NotNull/@Nullable problems 🔶 Warning 2
Redundant character escape 🔶 Warning 2
Call to 'printStackTrace()' 🔶 Warning 2
Unchecked warning 🔶 Warning 2
Unstable API Usage 🔶 Warning 2
Constant values 🔶 Warning 1
Dangling Javadoc comment 🔶 Warning 1
Field can be local 🔶 Warning 1
Redundant local variable 🔶 Warning 1
Unnecessary call to 'toString()' 🔶 Warning 1
Unused assignment 🔶 Warning 1
Bulk operation can be used instead of iteration 🔶 Warning 1
Commented out code ◽️ Notice 2
Method can be extracted ◽️ Notice 2

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report To be able to view the detailed Qodana report, you can either: - Register at [Qodana Cloud](https://qodana.cloud/) and [configure the action](https://github.com/jetbrains/qodana-action#qodana-cloud) - Use [GitHub Code Scanning with Qodana](https://github.com/jetbrains/qodana-action#github-code-scanning) - Host [Qodana report at GitHub Pages](https://github.com/JetBrains/qodana-action/blob/3a8e25f5caad8d8b01c1435f1ef7b19fe8b039a0/README.md#github-pages) - Inspect and use `qodana.sarif.json` (see [the Qodana SARIF format](https://www.jetbrains.com/help/qodana/qodana-sarif-output.html#Report+structure) for details) To get `*.log` files or any other Qodana artifacts, run the action with `upload-result` option set to `true`, so that the action will upload the files as the job artifacts: ```yaml - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2024.1.5 with: upload-result: true ```
Contact Qodana team Contact us at [qodana-support@jetbrains.com](mailto:qodana-support@jetbrains.com) - Or via our issue tracker: https://jb.gg/qodana-issue - Or share your feedback: https://jb.gg/qodana-discussions