Comments

Topics


Apex Code Comments

Class level

tokendescription
@authorthe author of the class
@datethe date the class was first implemented
@groupa group to display this class under, in the menu hierarchy
@group-contenta relative path to a static html file that provides content about the group
@descriptionone or more lines that provide an overview of the class
/*******************************************************************************************
* @name         FruitService 
* @author       FirstName LastName <auth@email.com>
* @date         01/02/2022
* @group        Fruit Services
* @description  This class contains all methods related to managing Fruits in Salesforce.  
*******************************************************************************************/

/* 
MODIFICATION LOG
* Version          Developer          Date               Description
*-------------------------------------------------------------------------------------------
*  1.0              FullName          01/02/2022          Initial Creation                                                      
******************************************************************************************
*/

Method level

tokendescription
@descriptionone or more lines that provide an overview of the method
@param param namea description of what the parameter does
@returna description of the return value from the method
@exampleExample code usage. This will be wrapped in tags to preserve whitespace
/**************************************************************************************
* @description  This method finds count of the given Fruit  and returns it
* @param		String - name - Fruit name
* @return       Integer - Value retrieved . 
* @example     
* FruitService.getFruitsCount('mango')
**************************************************************************************/ 
public static IntegerI(String name) {
   // ... 
   
}

Tools to check for the comments in the repo

Check for comments in given folder with  Apex classes

USAGE
  $ sfdx mohanc:regex:apex:checkComments2 [-d <string>] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --directoryname=directoryname                                                 Directory containing Apex Class
                                                                                    files

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

EXAMPLE


    ** Check for comments in given folder with  Apex classes **
  
    $ sfdx  mohanc:regex:apex:checkComments2 -d <directory containing source code>
  

  • You can redirect the output to a file like this to open in your spreadsheet program
sfdx mohanc:regex:apex:checkComments2 -d ascent-develop/src/sales/channel-fundamentals/main/default/classes > REPO_comments2-status-jul-12-2022.csv

References