Skip to content
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

Clone Management #67

Open
wants to merge 89 commits into
base: main
Choose a base branch
from
Open

Clone Management #67

wants to merge 89 commits into from

Conversation

Ahmad-sh7
Copy link
Collaborator

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.

  • Tests are created and passing
  • Manual testing

Screenshots (if appropriate):

Types of changes

  • Pipeline changes
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have updated the CONTRIBUTORS file.
  • I have updated the CHANGELOG.

Copy link
Contributor

github-actions bot commented May 3, 2024

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 and configure the action
  2. Use GitHub Code Scanning with Qodana
  3. Host Qodana report at GitHub Pages
  4. Inspect and use qodana.sarif.json (see the Qodana SARIF format 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:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2023.3.1
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

import java.nio.file.Files;
import java.util.regex.Pattern;

public class CloneVfsTest extends LightPlatformCodeInsightTestCase {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is Vfs can you make this more explicit?

Copy link
Contributor

github-actions bot commented Aug 8, 2024

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

Copy link
Contributor

github-actions bot commented Aug 8, 2024

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:

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:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2024.1.5
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants