parseSeverity function Null safety

String parseSeverity(
  1. String analyzerSeverity
)

Map dartanalyzer severities to proper Code Climate severities. It is highly subjective but following solution presents the most balanced approach.

Implementation

String parseSeverity(String analyzerSeverity) {
  switch (analyzerSeverity) {
    case 'INFO':
      return 'info';
    case 'WARNING':
      return 'minor';
    case 'ERROR':
      return 'blocker';
  }

  return 'blocker';
}