Alibaba Java Coding Guidelines, after my Java code standards, depends on it

Foreword

       For Java code standards, the industry has unified standard, many companies this has certain requirements. But even so, the huge Java user experience is due to the limitation level, not necessarily conscious standardized coding, and even veteran Java programmer can not do the time will regulate to keep in mind. So for the code specifications scanning tools, once appeared on the widely popular, produced Alibaba Alibaba Java Coding Guidelines (Ali Baba Java code scanning Statute, hereinafter referred to as AJCG) plug-in is one of them. Compared with many other popular similar tools (such as FindBugs, Lint, etc.), it is more focused on the Java code specifications, and defaults to Chinese, English is not so good for developers, this is certainly a benefit. This will combine Android Studio (hereinafter referred to as AS), tell us about the use of the plug-in.

 

A, AJCG Profile

       To allow developers to more easily and quickly achieve standardized code format and put into practice, Alibaba manual is based on "Ali Baba Java Development Statute", developed an automated detection of IDE plug-ins, it is Alibaba Java Coding Guidelines plug. October 14, 2017 in Hangzhou Yunqi Assembly, AJCG global launching ceremony officially launched the formal specification to plug-in to open the industry to lead the way of the Java language specification. The plug-in after scanning the code, the code would be inconsistent with the statute by Blocker / Critical / Major three levels show up, and most can be automatically repaired. It also provides real-time detection mechanism based Inspection, write code at the same time can quickly find the problem.

 

Second, install the plug-in AS AJCG

       Like other plug-ins, AJCG plug-in also provides installation and manual off-line installation directly in the AS warehouse in two ways.

  1, AS downloaded directly from the installation of plug-in library

       As for how to install the plug-in plug-in library in AS, in my other article on FindBugs article [ https://www.cnblogs.com/andy-songwei/p/11820564.html ] has been introduced, there is not repeat. Briefly about that

  File> Settings> Plugins> Browse repositories search for "Alibaba Java Coding Guidelines", follow the prompts to install, and then restart.

  2, manually download and install from disk

       Offline obtain the installation package from the following address:

       Link: https: //pan.baidu.com/s/19MPJ-CVfZvf4K_PVXY8g6Q

       Extraction code: it10 

 

Third, the use AJCG

  1, start scanning AJCG 

       Can generally be started AJCG There are two ways to scan (as if there are other ways to start, we know that these two approaches is enough):

    (1) can Tools> Ali encoding statute> encoding scanning statute

    (2) in the project area to the left of the editing interface or AS, right click and select "Scan coding Statute" to the context menu.  

       

  2, menu functions

       The first way to start than the second one more feature, which lists three functions are as follows:

    (1) Scan the Statute encoding: Start scan code.

    (2) open / close detection in real time: real-time detection codes, by definition, real-time detection of the code. Good general performance of the machine, then you can turn this feature, if turned on, there will be "shut down real-time detection function" display.

    (3) switched to English Language: English switch.

  3, the results 

       After the scan is complete show results are as follows (if the current mouse click is the final item, right area shows other content, will be back again mentioned): 

   

  4, designated area searching for the same kind of problem

       When you click on the button at ③, the button will pop up as follows:

 

 Here select the scan area, to scan the mouse to select similar problems. If you follow the default choice, then run after the result:

 Here we can see that shows all the problems of the class throughout the Project.

  5, a specific non-standard codes preview

       In the implementation of the results of the third point, if the class file is clicked the ultimate problem or the problem, and that is to show the following interface, preview where non-standard code.

 

 

Fourth, the Toolbar Features

       The toolbar functions often used, where each function for simple brief:

  (1) Rerun Inspection: re-run a scan

  (2) Close: close a real panel AJCG

  (3) Expand All: Expand the tree structure results, the overall result is a tree structure.

  (4) Collapse All: Collapse result tree

  (5) Go Pre Problem: select a problem

  (6) Go Next Problem: to select the next question

  (7) Help: Help

  (8) Group by Serverity :( do not know how to describe)

  (9) Group by derectory: by directory group / inter-packet switching by class name

  (10) Filter resoled items: filtering out entries have been solved

  (11) Autoscroll to Source: automatically scrolls to the source

  (12) Export: Export, can be exported to XML and HTML formats

  (13) Edit Settings: Edit settings

 

V. scan results

       The part of the area shows the results, as is the Chinese version of the set, so the Chinese are shown here, it looks very cool.

       We can see Blocker (blocker), Critical (serious problems), Major (main) three categories, they said that the severity of the problem, the severity of the high to low: Blocker> Critical> Major. For each category will include what kind of problems, the figure of Chinese has it all, not go into here.

 

welfare

       This provides an "Ali Baba Java Development Manual (Commemorative Edition)" electronic document

       Links: https://pan.baidu.com/s/1z2u1ITJGJvgsJqrgq_AYwQ

       Extraction code: v9ja

 

Epilogue

       This article only describes some of the common use of AJCG, there must be a lot of cattle function, hope that readers have a lot to explore, more exchanges and common progress, thank you!

Guess you like

Origin www.cnblogs.com/andy-songwei/p/11823957.html