Skip to content

Commit 46013ee

Browse files
committed
docs: update README to reflect support for JSON export format and provide example output
1 parent 4f6a62a commit 46013ee

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ The `CodeLineCounter` project is a tool that counts the number of lines of code
1212

1313
Since version `1.0.2` it also check duplications in the code.
1414

15-
All the results are exported to CSV files.
15+
All the results are exported to CSV or JSON files.
1616

1717
## Features
1818

1919
- Counts the number of lines of code per file, namespace, and project.
2020
- Calculates the cyclomatic complexity of each file.
21-
- Exports the results to a CSV file.
21+
- Exports the results to a CSV or JSON file.
2222

2323
## Prerequisites
2424

@@ -62,13 +62,13 @@ dotnet build
6262
- Run the program by providing the directory path containing the solutions to analyze:
6363

6464
```sh
65-
dotnet run --project CodeLineCounter/CodeLineCounter.csproj -d "path/to/directory/with/solutions"
65+
dotnet run --project CodeLineCounter/CodeLineCounter.csproj -d "path/to/directory/with/solutions -format json"
6666
```
6767

6868
Or if you want verbose mode on :
6969

7070
```sh
71-
dotnet run --project CodeLineCounter/CodeLineCounter.csproj -verbose -d "path/to/directory/with/solutions"
71+
dotnet run --project CodeLineCounter/CodeLineCounter.csproj -verbose -d "path/to/directory/with/solutions -format json"
7272
```
7373

7474
- Select the solution to analyze by entering the corresponding number.
@@ -131,6 +131,27 @@ Code Hash,FilePath,MethodName,StartLine,NbLines
131131
0133e750c0fec3d478670cb0441882855926c415a35aacf0360508fdeb73c34c,C:\temp\NamespaceMetrics.cs,CodeLineCounter\Models\class.cs,EtablirCommunication,91,3
132132
```
133133

134+
## Example Output of CodeDuplication.json
135+
136+
```json
137+
[
138+
{
139+
"CodeHash": "0133e750c0fec3d478670cb0441882855926c415a35aacf0360508fdeb73c34c",
140+
"FilePath": "C:\\temp\\NamespaceMetrics.cs",
141+
"MethodName": "EtablirCommunication",
142+
"StartLine": 91,
143+
"NbLines": 3
144+
},
145+
{
146+
"CodeHash": "0133e750c0fec3d478670cb0441882855926c415a35aacf0360508fdeb73c78a",
147+
"FilePath": "C:\\temp\\NamespaceMetrics.cs",
148+
"MethodName": "CloseCommunication",
149+
"StartLine": 158,
150+
"NbLines": 30
151+
}
152+
]
153+
```
154+
134155
## Project Structure
135156

136157
```bash

0 commit comments

Comments
 (0)