001 /* 002 * Sonar, open source software quality management tool. 003 * Copyright (C) 2008-2012 SonarSource 004 * mailto:contact AT sonarsource DOT com 005 * 006 * Sonar is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 3 of the License, or (at your option) any later version. 010 * 011 * Sonar is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public 017 * License along with Sonar; if not, write to the Free Software 018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 019 */ 020 package org.sonar.plugins.findbugs; 021 022 import java.util.HashMap; 023 import java.util.Map; 024 025 public final class FindbugsCategory { 026 private static final Map<String, String> FINDBUGS_TO_SONAR = new HashMap<String, String>(); 027 028 static { 029 FINDBUGS_TO_SONAR.put("BAD_PRACTICE", "Bad practice"); 030 FINDBUGS_TO_SONAR.put("CORRECTNESS", "Correctness"); 031 FINDBUGS_TO_SONAR.put("MT_CORRECTNESS", "Multithreaded correctness"); 032 FINDBUGS_TO_SONAR.put("I18N", "Internationalization"); 033 FINDBUGS_TO_SONAR.put("EXPERIMENTAL", "Experimental"); 034 FINDBUGS_TO_SONAR.put("MALICIOUS_CODE", "Malicious code"); 035 FINDBUGS_TO_SONAR.put("PERFORMANCE", "Performance"); 036 FINDBUGS_TO_SONAR.put("SECURITY", "Security"); 037 FINDBUGS_TO_SONAR.put("STYLE", "Style"); 038 } 039 040 public static String findbugsToSonar(String findbugsCategKey) { 041 return FINDBUGS_TO_SONAR.get(findbugsCategKey); 042 } 043 044 private FindbugsCategory() { 045 } 046 }