A good API documentation is a key factor in the usability and success of a software API. It ensures that developers can effectively use, maintain, and collaborate on the API.
Undocumented APIs pose significant challenges in software development for several reasons:
It is recommended to document the API using ASDoc to clarify what is the contract of the API. This is especially important for public APIs, as they are used by other developers.
Classes or class elements with an ASDoc @private comment are ignored by this rule.
/**
* @private // This class and all its elements are ignored
*/
public class MyClass { // Compliant
public var myLabel:String; // Compliant
}
public class AnotherClass { // Noncompliant; class not @private and not documented
/**
* @private
*/
public var name:String; // Compliant
}
Add the missing ASDoc for the public classes, methods, properties and metadata.
public class MyClass {
public var myLabel:String;
public function myMethod(param1:String):Boolean {
// ...
}
}
/**
* my doc
*/
public class MyClass {
/**
* my doc
*/
public var myLabel:String;
/**
* my doc
* @param param1 my doc
* @return my doc
*/
public function myMethod(param1:String):Boolean {
// ...
}
}