|
I'm looking for the best approach to dealing with duplicate code in a legacy PHP project with about 150k lines of code.
Is this something best approached manually or are there standalone duplicate code detectors that will ease the pain?
Started by Ken on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Have to change code, it's most of the times faster to duplicate the code than to refactor it so it can years googling to this very same question you posted here!
The CloneDR finds duplicate code, both extraction of....
|
|
What tools can I used to find duplicate code that is a good candiate for refactoring?
Update:
Any language, any IDE.
Started by Justin Tanner on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Comparator
Name
comparator, filterator — fast location of common code
DESCRIPTION
comparator is a program for quickly finding common sections in two or more source-code.
Of is called Simian.
|
|
I've searched the Internet for a while now and I have not been able to find any free (or cheap) tools/utilities/modules that can analyze a set of Perl files (modules or scripts) and flag duplicate or cloned or copy/pasted code.
I'm better now, but I used...
Started by Kurt W. Leucht on
, 7 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Code Comparison and Plagirism....
There are several tools like http://pmd.sourceforge.net/ that can detect duplicate code by string matches.
What do you mean by duplicate code? Just character exact matches or semantic matches.
|
Ask your Facebook Friends
|
The challenge: The shortest code, by character count , that detects and removes duplicate characters in a String. Removal includes ALL instances of the duplicated character (so if you find 3 n's, all three have to go), and original character order needs...
Started by Alex on
, 42 posts
by 38 people.
Answer Snippets (Read the full thread at stackoverflow):
If you want, with original string and the VB....
Javascript 1.8 s.split('').filter of "".join(c for c in s if s.count(c)<2) , and it's virtually the same code anyway).
Strip all duplicate characters (S), Print the result to stdout (P).
|
|
I wish to get a quick feeling for how much “copy and paste” coding we have, there are many tools for C# / Java to check for this type of thing. Are there any such tools that work well with VB.NET?
(I have seen what looks like lots of repeated code, but...
Started by Ian Ringrose on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
[I'm the author of CloneDR ("Clone Doctor") .]
CloneDR.
Groovy source code and even plain text files.
|
|
I have the following goal:
I Have a list of top menu links on my website
Home * Links * Quotes * Photos
The only difference is that whenever you are on a particular page, I want that page to just be text (not a href link) and the others to be links (to...
Started by oo on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
In the code behind on the master page I had code....
I did the same thing using a master page, using ASP:Hyperlink controls .
You could expose a Bool on each page.
Create a UserControl for your common code and add a reference to each page.
|
|
Hello,
I heard it's not good to use cursors, as they "unnatural" to DBMS and they provide bad perfomance.
But imagine the following situation: I have a stored procedure and I need to call this stored procedure for every customer from France (for example...
Answer Snippets (Read the full thread at stackoverflow):
It's much easier to operate on sets of data in a well designed database than .
And the code you've written.
|
|
Suppose you have a subsystem that does some kind of work. It could be anything. Obviously, at the entry point(s) to this subsystem there will be certain restrictions on the input. Suppose this subsystem is primarily called by a GUI. The subsystem needs...
Started by Daniel Straight on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
For example your front end and backend....
Depending on your platform it may be possible to code the validation rules once.
This sound OK for example).
No code is duplicated.
The messages with their validation sit in a separate library .
|
|
I have an asp.net mvc website where i build up most of the page using C# for example building up html tables given a set of data from my viewmodel
i also have a lot of javascript that then dynamcially modifies these tables (add row for example).
the javascript...
Started by oo on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
This way you can call something like a CreateRow method ... .
One way to do this is to expose the logic that generates the markup as a web service on your server and have JavaScript get that markup via an AJAX call rather than duplicating the logic.
|
|
I am using Resharper for refactoring. What is this type of feature called when you have the same code in around 5 different events being called but you want to replace them with a method call? And place that code in that method.
All done automatically...
Started by Shawn Mclean on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
While it doesn't replace redundant code with function calls, it does.
See the C# CloneDR.
A section soon.
That is, it scans your code, searching for sections that can be replaced by an existing method call.
|