diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2019-03-26 15:52:21 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2019-03-29 09:44:58 +0100 |
commit | c9990b56c199f23d97694b9de677872ca15471c2 (patch) | |
tree | 4c0c1d47a2ef541f62310a4f921a1ee805f29046 | |
parent | 496a64705bb03ea7748d140698b5dbbc1af31325 (diff) | |
download | sonarqube-c9990b56c199f23d97694b9de677872ca15471c2.tar.gz sonarqube-c9990b56c199f23d97694b9de677872ca15471c2.zip |
Remove dead code
-rw-r--r-- | server/sonar-web/src/main/js/apps/portfolio/utils.ts | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/server/sonar-web/src/main/js/apps/portfolio/utils.ts b/server/sonar-web/src/main/js/apps/portfolio/utils.ts index f3d76eeab2e..ea66cfb7398 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/utils.ts +++ b/server/sonar-web/src/main/js/apps/portfolio/utils.ts @@ -17,40 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -export function getNextRating(rating: number): number | undefined { - return rating > 1 ? rating - 1 : undefined; -} - -function getWorstSeverity(data: string): { severity: string; count: number } | undefined { - const SEVERITY_ORDER = ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO']; - - const severities: T.Dict<number> = {}; - data.split(';').forEach(equality => { - const [key, count] = equality.split('='); - severities[key] = Number(count); - }); - - for (let i = 0; i < SEVERITY_ORDER.length; i++) { - const count = severities[SEVERITY_ORDER[i]]; - if (count > 0) { - return { severity: SEVERITY_ORDER[i], count }; - } - } - - return undefined; -} - -export function getEffortToNextRating( - measures: Array<{ metric: { key: string }; value: string }>, - metricKey: string -) { - const measure = measures.find(measure => measure.metric.key === metricKey); - if (!measure) { - return undefined; - } - return getWorstSeverity(measure.value); -} - export const PORTFOLIO_METRICS = [ 'projects', 'ncloc', |