What you really want to do is see if there is code cloned (copied) across the two projects (both projects consisting of possibly large sets of files). You can do this by running a clone detection tool. Wikipedia lists a variety of them.
To decide grossly if there is lot of copying, you only need to match source lines, and there are a variety of exact source-line clone detectors out there. I believe PMD is one of them. What these won't do is find code that is copy-paste-edited; they will find boilerplate copy-paste-unchanged code likely wrapped around the copy-past-edited stuff.
If you want to see the details of the copying for copy-past-edit code, you need a clone detector that finds "parameterized" clones. Token based detectors do this for edits which replace just variable names or constants.
Abstract-syntax tree (AST) based detectors do this for edits involving larger chunks, such as expressions, statements, insertions, deletions, et. These latter tend to give better answers, because unlike the token detectors, they can use the language structure of the computer source code as a guide.
Our CloneDR tool is such a detector.
I don't know of tools that will actually find "equivalent" code (reversed conditionals), etc. Researchers have built clone detectors that do something like this, but the combinatorics make this very expensive to execute, and the research prototypes scaled poorly.