Skip to content

C# static analyzer refactoring#856

Open
matecsad wants to merge 2 commits intoEricsson:feature/csharp_pluginfrom
matecsad:pr-584-fixes
Open

C# static analyzer refactoring#856
matecsad wants to merge 2 commits intoEricsson:feature/csharp_pluginfrom
matecsad:pr-584-fixes

Conversation

@matecsad
Copy link
Copy Markdown
Collaborator

@matecsad matecsad commented May 2, 2026

Fixes the pending issues in #584.

@matecsad matecsad added Plugin: C# Issues related to the parsing and presentation of C# projects. Kind: Refactor 🔃 labels May 2, 2026
@matecsad matecsad requested a review from mcserep May 2, 2026 19:41
@matecsad matecsad self-assigned this May 2, 2026
@mcserep mcserep added this to Lab and Roadmap May 5, 2026
@github-project-automation github-project-automation Bot moved this to In progress in Roadmap May 5, 2026
@github-project-automation github-project-automation Bot moved this to In progress in Lab May 5, 2026

namespace CSharpParser
{
class AstVisitorHelper
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be a static class with static helper methods.


namespace CSharpParser
{
class ProgramHelper
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be a static helper class with static methods.

return allFiles;
}

public static string transformConnectionString(string _connectionString)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PascalCase naming convention not enforced here.

using cc.service.csharp;
using CSharpParser.model;

class QueryHelper
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Class has no state, should be a static helper class.


class QueryHelper
{
public AstNodeInfo createAstNodeInfo(CsharpAstNode node)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Method names should be in PascalCase.

return ret;
}

public List<AstNodeInfo> createAstNodeInfoList(List<CsharpAstNode> nodeList)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Method names should be in PascalCase.

return ret;
}

public FileRange getFileRange(CsharpAstNode node)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Method names should be in PascalCase.

Comment thread .gitignore
Comment on lines 13 to +16
build/
build_*/
Build/
Build_*/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
build/
build_*/
Build/
Build_*/
[bB]uild/
[bB]uild_*/

This can be simplified.

@mcserep mcserep changed the title PR 584 fixes C# static analyzer fixes May 5, 2026
@mcserep mcserep changed the title C# static analyzer fixes C# static analyzer refactoring May 5, 2026
Comment thread plugins/csharp/csharp.sln
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "parser", "parser", "{BC34E35A-B109-A120-90EC-15530B70B9CB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbModel", "db_model\DbModel.csproj", "{BADE2559-4F0F-21F6-067B-8EDF7DE9DFC1}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does exist in the project.

Comment thread plugins/csharp/csharp.sln
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "db_model", "db_model", "{2E2F0E00-502D-A052-0019-82CFB9270E3D}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does exist in the project.

Comment thread plugins/csharp/csharp.sln
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "csharpservice", "service\src_csharp\csharpservice.csproj", "{1AF03105-21A5-3508-A40F-365ADA9DFF92}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src_csharp", "src_csharp", "{37C60329-C8F7-3ACB-DE03-F714C9EE58C5}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does exist in the project, as the src_csharp folder is per parser / service.

Comment thread plugins/csharp/csharp.sln
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This solution file looks invalid. Maybe just remove it, as the project files contain enough structure for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Kind: Refactor 🔃 Plugin: C# Issues related to the parsing and presentation of C# projects.

Projects

Status: In progress
Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants