Swift

Swift

Made by DeepSource

Missing documentation comment SW-D1001

Documentation
Minor

It is recommended to have documentation comments above functions, methods, classes and protocols. This helps library users, other developers and even the author to understand the purpose of a code snippet or an API function in the future.

NOTE: If you want to stop this issue from getting raised on certain constructs consider using the skipdoccoverage option under the analyzers.meta property in your .deepsource.toml file. For example, the following configuration will silence this issue for classes and protocols:

[analyzers.meta]
    skip_doc_coverage = ["class", "protocol"]

Bad Practice

func sum(firstNumber, secondNumber) {
  return firstNumber + secondNumber;
}

Recommended

/**
  Function to add two numbers.

  - Parameters:
    - firstNumber: The first number to add
    - secondNumber: The second number to add

  - Returns: The sum of two numbers
 */
func sum(firstNumber, secondNumber) {
  return firstNumber + secondNumber;
}