Hello.
I work for the same company as Arne and Hansjörg. In my spare time, I created a small tool called XsDupFinder, that some of you might find useful. With XsDupFinder you can analyze x# source code for duplicate code fragments. You can download it from my github repository. I also created a small tutorial on how to use it and how to interpret the generated html file.
Let me know what you think about it.
Regards
Volkmar
XsDupFinder
XsDupFinder
Hi Volkmar,
if you are working with Arne, then we share a very similar weather today <g>.
Thank you four your tool - I have tested it over my greatest X# project now.
The output is very interesting and useful.
For a regular use an exclusion pattern would be a good thing - both excluding files and directories with regular expressions.
And also maybe an inclusion pattern: only files and directories to check - multiple and with regular expressions.
Wolfgang
P.S. the project I checked has 417 files (counted by your tool), in about 100 folders
if you are working with Arne, then we share a very similar weather today <g>.
Thank you four your tool - I have tested it over my greatest X# project now.
The output is very interesting and useful.
For a regular use an exclusion pattern would be a good thing - both excluding files and directories with regular expressions.
And also maybe an inclusion pattern: only files and directories to check - multiple and with regular expressions.
Wolfgang
P.S. the project I checked has 417 files (counted by your tool), in about 100 folders
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
XsDupFinder
Very nice, I tested it against some of my code that I knew had duplicates and I think it found them all! Plus several more that I was not aware of
Good job!
Good job!
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
- softdevo@tiscali.it
- Posts: 191
- Joined: Wed Sep 30, 2015 1:30 pm
XsDupFinder
Thanks, very useful, nice idea,
Danilo
Danilo
XsDupFinder
Hello Volkmar,
Indeed very interesting. Our main duplicate code is g.i.prg and i.prg (whatever it may be, something to do with Visual Studio generated file I think and VS and Microsoft are master in duplicating everything multiple times). Other duplicates in my first tested project are only a few lines of code which one wouldn't make a common method for anyway. But I am convinced that in our VO projects there's a lot more, and I will run it soon from the XPorted X# exports.
Thanks!
Dick
Indeed very interesting. Our main duplicate code is g.i.prg and i.prg (whatever it may be, something to do with Visual Studio generated file I think and VS and Microsoft are master in duplicating everything multiple times). Other duplicates in my first tested project are only a few lines of code which one wouldn't make a common method for anyway. But I am convinced that in our VO projects there's a lot more, and I will run it soon from the XPorted X# exports.
Thanks!
Dick
XsDupFinder
Dick,
These files are generated for each XAML file. The .f.i.prg is for "interactive use" (inside VS) and trhe .g.prg gets created during the built process.
Robert
These files are generated for each XAML file. The .f.i.prg is for "interactive use" (inside VS) and trhe .g.prg gets created during the built process.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
XsDupFinder
Hello Robert,
I've got another such issue, not sure how to solve it. I've got a html help file + pictures in a subdirectory of the program directory, like this:
string cHelp = "HelpDataPhotOrganize" + Globals.cLang + ".html";
Helpdata are found perfectly regardless the installation. The program is submitted to the Windows Store so I have no control of the directory used.
But this also means that I have to duplicate this full HelpData directory; once in Debug and once in Release (if I want to see the helpfile in both modes).
What would be the best way to prevent this?
Dick
Thanks for explaining. I keep wondering however why so many files (like these 2) are exactly duplicated.robert wrote: These files are generated for each XAML file. The .f.i.prg is for "interactive use" (inside VS) and trhe .g.prg gets created during the built process.
Robert
I've got another such issue, not sure how to solve it. I've got a html help file + pictures in a subdirectory of the program directory, like this:
string cHelp = "HelpDataPhotOrganize" + Globals.cLang + ".html";
Helpdata are found perfectly regardless the installation. The program is submitted to the Windows Store so I have no control of the directory used.
But this also means that I have to duplicate this full HelpData directory; once in Debug and once in Release (if I want to see the helpfile in both modes).
What would be the best way to prevent this?
Dick
XsDupFinder
Dick,
Put the HelpData folder in your project and mark the files in that folder with "copy to output directory"
Robert
Put the HelpData folder in your project and mark the files in that folder with "copy to output directory"
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
XsDupFinder
Hi.
thanks for the feedback.
@Wolfgang: I'll see if I can add an "include only" and "exclude" option. But since RegEx is kinda complicated, I'll probably use Glob which should be powerful enough.
@Dick: I have to check, if I can detect and automatically ignore these generated files, because duplicated code in generated files is not problematic.
regards
Volkmar
thanks for the feedback.
@Wolfgang: I'll see if I can add an "include only" and "exclude" option. But since RegEx is kinda complicated, I'll probably use Glob which should be powerful enough.
@Dick: I have to check, if I can detect and automatically ignore these generated files, because duplicated code in generated files is not problematic.
regards
Volkmar