66
77** Updates:**
88
9- - 🔥 Introducing [ duplo-action] ( https://github.com/dlidstrom/duplo-action ) for using Duplo in GitHub Actions!
9+ - 🔥 v1.2 support for reporting in json format (thanks [ @cgkantidis ] ( https://github.com/cgkantidis ) !)
10+ - [ Performance improvements] ( #71-performance-measurements ) : it now takes ~ 9s to process Quake 2 source! (thanks [ @cgkantidis ] ( https://github.com/cgkantidis ) !)
11+ - Introducing [ duplo-action] ( https://github.com/dlidstrom/duplo-action ) for using Duplo in GitHub Actions!
1012- v1.1 improve memory usage (grabbed from [ @nachose fork] ( https://github.com/nachose/Duplo ) ), also re-enabled tests and organized code
1113- 🚀 v1.0 add build on Windows (thanks [ @chausner ] ( https://github.com/chausner ) !)
1214- v0.8 adds improved Java support
@@ -64,15 +66,14 @@ find . -type f \( -iname "*.cpp" -o -iname "*.h" \) | ./duplo -ml 20 -ip - -
6466- [ 2. Maintainer] ( #2-maintainer )
6567- [ 3. File Format Support] ( #3-file-format-support )
6668- [ 4. Installation] ( #4-installation )
67- - [ 4.1. Docker] ( #41-docker )
68- - [ 4.2. Pre-built binaries] ( #42-pre-built-binaries )
69+ - [ 4.1. Pre-built binaries] ( #41-pre-built-binaries )
6970- [ 5. Usage] ( #5-usage )
7071 - [ 5.1. Passing files using ` stdin ` ] ( #51-passing-files-using-stdin )
7172 - [ 5.1.1. Bash] ( #511-bash )
7273 - [ 5.1.2. Windows] ( #512-windows )
73- - [ 5.1.3. Docker] ( #513-docker )
7474 - [ 5.2. Passing files using file] ( #52-passing-files-using-file )
75- - [ 5.3. Xml output] ( #53-xml-output )
75+ - [ 5.3. Json output] ( #53-json-output )
76+ - [ 5.4. Xml output] ( #54-xml-output )
7677- [ 6. Feedback and Bug Reporting] ( #6-feedback-and-bug-reporting )
7778- [ 7. Algorithm Background] ( #7-algorithm-background )
7879 - [ 7.1. Performance Measurements] ( #71-performance-measurements )
@@ -137,19 +138,7 @@ src\engine\geometry\SkinnedMeshGeometry.cpp(45)
137138
138139## 4. Installation
139140
140- ### 4.1. Docker
141-
142- If you have Docker, the way to run Duplo is to use this command:
143-
144- ``` bash
145- # Docker on unix
146- > docker run --rm -i -w /src -v $( pwd) :/src dlidstrom/duplo
147- ```
148-
149- This pulls the latest image and runs duplo. Note that you'll have to pipe the
150- filenames into this command. A complete commandline sample will be shown below.
151-
152- ### 4.2. Pre-built binaries
141+ ### 4.1. Pre-built binaries
153142
154143Duplo is also available as a pre-built binary for (Alpine) Linux, macOS and
155144Windows. Grab the executable from the
@@ -194,30 +183,6 @@ written to `out.txt`.
194183This works similarly to the Bash command, but uses PowerShell commands to
195184achieve the same effect.
196185
197- #### 5.1.3. Docker
198-
199- ``` bash
200- # Docker on unix
201- > find . -type f \( -iname " *.cpp" -or -iname " *.h" \) | docker run --rm -i -w /src -v $( pwd) :/src dlidstrom/duplo - out.txt
202- ```
203-
204- This command also works in a similar fashion to the Bash command, but instead of
205- piping into a local ` duplo ` executable, it will pipe into ` duplo ` running inside
206- Docker. This is very convenient as you do not have to install ` duplo `
207- separately. You will have to install Docker though, if you haven't already. That
208- is a good thing to do anyway, since it opens up a lot of possibilities apart
209- from running ` duplo ` .
210-
211- Again, similarly to the Bash command, this uses ` find ` to find files in the
212- current directory, then passes the file list to Docker which will pass it
213- further into an instance of the latest version of ` duplo ` . The working directory
214- in the ` duplo ` container should be ` /src ` (that's where the ` duplo ` executable
215- is located) and the current path of your host machine will be mapped to ` /src `
216- when the container is running. The ` -i ` allows ` stdin ` of your host machine to
217- be passed into Docker to allow ` duplo ` to read the filenames. Any parameters to
218- ` duplo ` can be placed at the end of the command as you can see ` - out.txt ` has
219- been.
220-
221186### 5.2. Passing files using file
222187
223188` duplo ` can analyze files specified in a separate file:
@@ -230,15 +195,16 @@ been.
230195# windows
231196> Get-ChildItem -Include " *.cpp" , " *.h" -Recurse | % { $_ .FullName } | Out-File -encoding ascii files.lst
232197> Duplo.exe files.lst out.txt
233-
234- # Docker on unix
235- > find . -type f \( -iname " *.cpp" -o -iname " *.h" \) > files.lst
236- > docker run --rm -i -w /src -v $( pwd) :/src dlidstrom/duplo files.lst out.txt
237198` ` `
238199
239200Again, the duplicated blocks are written to ` out.txt` .
240201
241- # ## 5.3. Xml output
202+ # ## 5.3. Json output
203+
204+ Using ` -json < filename> ` you can output the result as json. This may be useful
205+ if you want to process the result further.
206+
207+ # ## 5.4. Xml output
242208
243209Duplo can also output xml and there is a stylesheet that will format the result
244210for viewing in a browser. This can be used as a report tab in your continuous
@@ -258,7 +224,10 @@ for further information.
258224
259225| System | Files | Loc' s | Time |
260226|-|-|-|-|
261- | Quake2 | 266 | 102740 | 18sec |
227+ | Quake2 | 266 | 102740 | 9sec |
228+
229+ This was measured on modern hardware anno 2025. It means Duplo is able to
230+ process more than 10 thousand lines of code (or 26 files) per second.
262231
263232## 8. Developing
264233
0 commit comments