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.

Why is this an issue?

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.

Exceptions

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
}

How to fix it

Add the missing ASDoc for the public classes, methods, properties and metadata.

Code examples

Noncompliant code example

public class MyClass {
  public var myLabel:String;

  public function myMethod(param1:String):Boolean {
    // ...
  }
}

Compliant solution

/**
 * 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 {
    // ...
  }
}

Resources

Articles & blog posts