fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

XsDupFinder 10 Oct 2020 19:10 #16174

  • VR's Avatar

  • VR

  • Topic Author


  • Posts: 2
  • 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

    Please Log in or Create an account to join the conversation.

    Last edit: by VR.

    XsDupFinder 11 Oct 2020 07:40 #16175

  • wriedmann's Avatar

  • wriedmann


  • Posts: 2395
  • 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
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    XsDupFinder 11 Oct 2020 07:45 #16176

  • Chris's Avatar

  • Chris


  • Posts: 2166
  • 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!
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    XsDupFinder 12 Oct 2020 11:39 #16181

  • softdevo@tiscali.it's Avatar



  • Posts: 118
  • Thanks, very useful, nice idea,
    Danilo

    Please Log in or Create an account to join the conversation.

    XsDupFinder 12 Oct 2020 20:51 #16187

  • ic2's Avatar

  • ic2


  • Posts: 788
  • 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

    Please Log in or Create an account to join the conversation.

    XsDupFinder 14 Oct 2020 14:20 #16203

  • robert's Avatar

  • robert


  • Posts: 1895
  • 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
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    XsDupFinder 15 Oct 2020 23:36 #16215

  • ic2's Avatar

  • ic2


  • Posts: 788
  • Hello Robert,

    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


    Thanks for explaining. I keep wondering however why so many files (like these 2) are exactly duplicated.

    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 = "\\HelpData\\PhotOrganize" + 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

    Please Log in or Create an account to join the conversation.

    XsDupFinder 15 Oct 2020 23:46 #16219

  • robert's Avatar

  • robert


  • Posts: 1895
  • Dick,

    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

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1