Code refactoring is sometimes boring. String replacement and other operations are not only boring, but also prone to errors. Fortunately, some tools are available, taking PHP as an example, such as Rephactor, scisr and so on, but the ready-made tools often mean that they are not flexible enough. So today I want to talk
file under C: Program FilesMicrosoft StyleCop *** in the installation directory.Analysis
Right-click the project and choose "Run StyleCop" to view the analysis result.
Specific troubleshooting methods:
Enter SA in the index column of the C: Program FilesMicrosoft StyleCop *** DocsStyleCop. chm document to view the cause and standard method.FxCop Introduction
Code
Summary:
1: Test requirements
2: Run automated testing in
3: Automated Testing Without
In the previous article "C # using API to achieve the compilation of Black Box automated testing tools" (http://www.cnblogs.com/luminji/archive/2010/11/03/1867730.html), we use windows api to achieve the compilation of automated testing tools. However, this method requires met
ontology, then a single function is established to express those different values in Parameters .
Motivation:
1, generally because there are a few different values, so set up a number of similar functions.
2. The separated function is replaced by a unified function, and the parameters are used to deal with those changes to simplify the problem.
3, remove duplicate code, improve flexibility. --You can use this pa
As PHP transforms from a simple scripting language into a mature programming language, the complexity of a typical PHP application's code base increases. To control the support and maintenance of these applications, we can use a variety of test tools to automate the process. One is unit testing, which allows you to directly test the correctness of the code you wr
C #. NET Verification Code Intelligent Recognition learning notes --- 06 solve the java jre problem: when JTessBoxEditor. jar is opened, it cannot be found or the Main class com. sun. tools. javac. Main cannot be loaded,
Technology qq exchange group: JavaDream: 251572072Download the tutorial and communicate online: it.yunsit.cn
I found this problem online,
Probl
Although using a lot of Ides, but as a lazy developer, I still like visual Studio, simple, convenient, powerful, a word, like ...
Although Visual Studio comes with the ability to refactor code, the ReSharper Extension tool makes Visual Studio's code refactoring feature even more powerful.
The ReSharper features include:
1 Analyzing
For example, vb.net code:For each prop in entity. Details.Properties.All (). OfType (of Microsoft.LightSwitch.Details.IEntityStorageProperty) () If Prop. Name Code to C #:foreach (Var prop in entity. Details.Properties.All (). OftypeCode conversion Tool Links: Http://www.ttrar.com/html/VBNet-to-C-Sharp-Converter.html#downVb. NET to
1#:java Language Converter HelperAddress: http://www.microsoft.com/en-us/download/details.aspx?id=143492#:octopus. NET ConvertersAddress: http://www.remotesoft.com/octopus/3#:tangible Java to C # ConverterAddress: http://www.tangiblesoftwaresolutions.com/Product_Details/Java_to_CSharp_Converter.html4#:xes Java to C # ConverterAddress: http://www.euclideanspace.com/software/language/xes/userGuide/convert/jav
In the previous series of articles, I was concerned about re-organizing your function in one of the PHP Miscellaneous "refactoring-improving the design of existing code", but I still didn't think I made it clear, I also have a lot of points that I don't understand, and this is my first article in this regard. There are a lot of mistakes, so I will make frequent changes, if you have good comments, let us kno
1Study Plan1. Implement area Import functionN ocupload One-click Upload plugin to usen upload the file to the ActionN POI Introductionn using POI to parse an Excel fileN Complete Database operationn generate simple code and City code using pinyin4j2, regional paging queryN Page AdjustmentN Server-side implementation3. Refactoring the paging codeN baseactionN sub-
independent class. The new extracted object is a function object.15. Message Chains (over-coupled Message Chains)
Object A requests object B, object B requests Object C ...:
If you see that the user requests another object from one object, then the latter requests another object, and then requests another object ...... This is the message chain. In actual code, you may see a long string of getthis () or a
, this division of responsibility is achieved through multi-inheritance. In C #, you can use interfaces to demonstrate and implement the preceding requirements.
There are some similarities between extract subclass and extract interface. Extract interface (extract Interface) can only extract common interfaces, but cannot extract common code. The use of extract interface (extract Interface) may cause an unple
, let's talk about it. Because we often do not reach such a high level and can cover all aspects before coding, it is unnecessary to spend too much time on code design. But the design still needs to be done, which can be rough. Of course, annotations cannot be added after the code is compiled, and half of the functions will be lost. Half of a good comment is to write a clearer
. parameters are used to handle those changes to simplify the problem. 3. Remove duplicate codes to improve flexibility. -- You can use this parameter to handle other changes.
Example:
Replace Parameter with Explicit Methods
Status:You have a function that takes a different response depending on the parameter value.
Creates an independent function for each value of this parameter..
Motivation:1. If a parameter has discrete values, and these parameter values are checked in the function in a co
provided the service itself, but if you need to use the function multiple times, you have to repeat the code, remember?
Repeating code is the root of the software.
These duplicate codes should be pumped out using extract method to put into the same function, of course, if you have to perform this refactoring, this also gives you a clear signal: Thi
JS also have a period of time, but also read a few books about JS, from the original "sharp jquery" "High performance Javasrcipt" to "JavaScript design mode" and so on, although read some books, see the Book of various theories and techniques, but in the actual use, The real use is not much.JS Object-oriented and I am familiar with the C # and other languages of the object-oriented slightly different, but the basic will have encapsulation, inheritance
10879-code Refactoring
Time limit:3.000 seconds
Http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=100page=show_ problemproblem=1820
"Harry, my dream are a code waiting to be broken. Break the code, solve the crime. Agent Cooper
Several algorithms in modern cryptography are based on the fac
commas as follows:Horizontal dynamic expansion: Lasted three years, and finally waited for the Redis 3.0 to be expected. The new version mainly realizes the function of cluster, and then automatically migrates the data after adding or deleting the cluster nodes. The core of enabling Redis cluster online reconfiguration is the ability to move slots from one node to another. Because a hash slot is actually a collection of keys, what the Redis cluster really does when it hashes (rehash) is to move
It re-organizes internal code without changing system behavior, improves comprehensibility and reduces modification costs.
A small modification involves multiple places, and these points are unknown.
Not easy to understand code (including reading your own code one month ago)
It takes a long time for a newbie to modify the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.