When I am making applications in Xcode, I sometimes find that I write duplicate code.

Is there a way in Xcode to find duplicate code in all files? I would like to know this because I would put the code into a function instead.

  • @pjctech Swift. Added it as a tag. – iProgram Jan 7 '17 at 10:44

Not in Xcode itself, but there are third party solutions. They both can analyse Swift code.

  1. PMD, it includes CPD, the copy-paste-detector.
  2. jscpd, a copy/paste detector for programming source code
| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .