IsInfoEnable () and reviewisinfoenable of code review
Last week, I had nothing to do with scanning the original code of the system and suddenly found such a piece of code:
if(log.isInfoEnable()){ log.info("ID"+userID+"pwd"+userPwd);}
Because the previously written log classes are internal log classes of the company,
The ultimate goal of sourceanalysis (stylecop) is to make everyone write elegantly and consistentlyCodeTherefore, these codes are highly readable.
Sourceanalysis (stylecop) is not a code formatting tool, but a code specification checking tool (Code review tool). It not only checks the
scannerInstalling the Sonarqube plugin plugin System Management - plug-in management, optional plug-in->sonarqube plugin click to installinstalling Sonarqube Scanner System Management ->sonarqube scanner configuration link SonarQube System Management-system settings-SonarQube servers Log on to Sonarqube Web side, find Administrator login-administrator-"security-" User Start creating a project test Create a maven project named Test_scan_sonar I put the
thread-safe. groupby groupingSuppose you want to observe the number of bugs that the program appears in, grouping them into categories:Bugs. GroupBy (bug = Bug . AssignedTo) new {Developer = list. Key, Count = list. Count ()}) = = X.count);The result is a igroupingWhen you study enumerable classes, you tend to feel confused about what happened--for example, an overloaded version of GroupBy has 4 type parameters and 5 "normal" parameters (3 are delegates). But don't
Under the recommendation of Mr. Wang, I finished reading the book in about 1 months. Feeling really benefited and felt a lot. This book is called: Code complete, as the book says, this book is about the software-building technology needed to reach the important milestone of "coding done," exactly how to write high-quality code.High-quality code can be said to be a cost-saving issue or a software security is
Label: SP problem code bs c ++ program object method testAfter reading the code of teammate Ma Yue's first personal project, he learned a lot due to his poor level. The summary is as follows:Advantages: The structure is clear, the class encapsulation is well done, there are methods in the class, very organized, easy to understand, better reflects the object-oriented thinking.Disadvantages: 1. It may be the
Contents:A progress plan review, QA found missingCodeIn the review phase, PM added a review code task after all coding tasks, so the progress plan passed the review. Code review is not
Tim Bray, XML collaborators and Google Android Development Ambassador, submitted a new draft HTTP status code for webpages that cannot be displayed due to legal restrictions. The new status code is "451 Unavailable for Legal Reasons", visitors will know that the requested webpage or resources are inaccessible for national review Reasons.
According to draft 451,
programming, but the feeling of the generated parts is not as independent as the Main function. Security1.Are all data inputs checked (for the correct type, length, format, and range) and encoded?This is not done, but the teacher also seems to mention in the homework requirements this time does not involve the detection of the legitimacy of the input.2.Are output values checked and encoded?Check over, no encode ...3.Are invalid parameter values handled?No, same 1 .Documentation1.Do comments exi
Advantages:
1. There are many annotations first! Feeling warm ...... At the same time, I am ashamed of the code without comments... When writing code, I often do not bother to write comments. When reading other people's code, I always speak out without comments. That's what I do... So I think it's really touching!
2. The structure is clear and the process is ea
Magic number/string
If statement, you should always use a single line or brackets
Provide default value of Enum
Difference between abstract class and interface
Excess inheritance--the inheritance hierarchy is too deep
Use String. Concat, String. Format, StringBuilder instead of +
break down large method to small methods
Using Nest class to hidden information are not necessary and hurts
Well, a one-month-long Dream break code reading program finally ended, at the request of Mr. Wang, I have a cursory glance over the book, see where I like to slow down, savor."Dream Break Code" is to speak, but also to talk about Baiqian things, is to write a software, but also write Baiqian software, is to write a group of people, but also write millions people. It is true that there is a big story in the
Label: SP code BS time Algorithm Program nbsp performance cannotFunction: The question requires that the functions are basically met, and elevator scheduling can be completed, which is also better than the original code scheduling.Performance: the performance is higher than the original scheduling algorithm, and the waiting time is reduced.Code: the code style is
to access the remote database, you need to modify the section:--For Master (this refers to the host that created the database)A. Modifying the/etc/postgresql/9.4/main/postgresql.confOriginal content:# listen_addresses = ' localhost ' after modification ( Remove the # comment):listen_addresses = ' * ' #监听来自所有ip的访问数据库请求B. Modifying/etc/postgresql/9.4/main/pg_hba.conf (hba=host-based authentication)# IPv4 Local connections:host all 127.0.0.1/32#新增内容, you can add several IP segments tha
names like X1 and X2 is thatEven if you know what x means, you can't tell the relationship between X1 and X2. Too long a name is hard to write, and it also makes the program viewThe structure of the sensation becomes blurred. When the study found that the average length of a variable name was 10 to 16 characters,The effort required to debug the program is minimal. The average name of a program with a length of 8 to 20 characters is also almost as easy to debug. This principle does not mean that
For the first personal project, I tried my best to complete it. The final effect was satisfactory. The following are some of my ideas after I read my partner's code.
The first advantage is:
1. Detailed annotations are provided from the beginning to the end. This is worth learning.
2. There are some interactions with users. This is a very good style, so that users can easily understand the functions and Input specifications of the program.
The foll
Peer programming and code review are mentioned in extreme programming. Anyone who understands programming a little bit will agree. This also reflects the importance and necessity of code review. However, in the actual execution process, it is often difficult to execute the code
elements in a collection of records in bulk together (which should be in the same region) and get good performance when traversing the results.(3) Scan can add filters through the SetFilter method, which is the basis of paging and multi-criteria queries.After satisfying the length, the three columns, the unique principle, we need to consider how to design rowkey to take advantage of the scope function of the scan method, so that the query speed of obtaining a batch of records can be improved.
Contents:A progress plan review, QA found missingCodeIn the review phase, PM added a review code task after all coding tasks, so the progress plan passed the review. Code review is not
Project Management Dafa Archive-mind mapping, prototyping tools, interface testing, design patterns, versioning, unit testing, continuous integration, code review, Bug trackingThe beautiful Life of the Sun Vulcan (http://blog.csdn.net/opengl_es)This article follows "Attribution-non-commercial use-consistent" authoring public agreementReprint Please keep this sentence: Sun Vulcan's Beautiful Life-this blog f
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.