<commit_before>/*
 * Copyright 2010-2020 <NAME>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
 * ANY KIND, either express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.monits.gradle.sca

import groovy.transform.CompileStatic
import org.gradle.api.JavaVersion
import org.gradle.util.GradleVersion

/**
 * Utility class to manage versions of tools being used by the plugin.
*/
@CompileStatic
final class ToolVersions {
    private final static String LATEST_PMD_TOOL_VERSION = '6.20.0'
    private final static String BACKWARDS_PMD_TOOL_VERSION = '5.1.3'
    private final static GradleVersion GRADLE_VERSION_PMD = GradleVersion.version('2.4')

    private final static String LATEST_CHECKSTYLE_VERSION = '8.23'
    private final static String LATEST_CHECKSTYLE_VERSION_JAVA_7 = '6.19'
    private final static String BACKWARDS_CHECKSTYLE_VERSION = '6.7'
    private final static GradleVersion GRADLE_VERSION_CHECKSTYLE = GradleVersion.version('2.7')

    private final static String SPOTBUGS_TOOL_VERSION = '4.0.1'
    private final static String SPOTBUGS_MONITS_VERSION = '0.2.0'
    private final static String SB_CONTRIB_VERSION = '7.4.6'

    private final static String TOOL_GRADLE = 'Gradle'
    private final static String TOOL_JRE = 'Java'
    private final static String UPDATE_INSTRUCTIONS = 'Update the used %s version to %s or higher to ' +
        'get better (and faster) analysis results.'

    private ToolVersions() {
        throw new AssertionError("ToolVersions can't be instantiated" as Object)
    }

    static String getPmdVersion() {
        if (GradleVersion.current() < GRADLE_VERSION_PMD) {<commit_msg>Bump PMD and Spotbugs to latest<commit_after>/*
 * Copyright 2010-2020 <NAME>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
 * ANY KIND, either express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.monits.gradle.sca

import groovy.transform.CompileStatic
import org.gradle.api.JavaVersion
import org.gradle.util.GradleVersion

/**
 * Utility class to manage versions of tools being used by the plugin.
*/
@CompileStatic
final class ToolVersions {
    private final static String LATEST_PMD_TOOL_VERSION = '6.22.0'
    private final static String BACKWARDS_PMD_TOOL_VERSION = '5.1.3'
    private final static GradleVersion GRADLE_VERSION_PMD = GradleVersion.version('2.4')

    private final static String LATEST_CHECKSTYLE_VERSION = '8.23'
    private final static String LATEST_CHECKSTYLE_VERSION_JAVA_7 = '6.19'
    private final static String BACKWARDS_CHECKSTYLE_VERSION = '6.7'
    private final static GradleVersion GRADLE_VERSION_CHECKSTYLE = GradleVersion.version('2.7')

    private final static String SPOTBUGS_TOOL_VERSION = '4.0.2'
    private final static String SPOTBUGS_MONITS_VERSION = '0.2.0'
    private final static String SB_CONTRIB_VERSION = '7.4.6'

    private final static String TOOL_GRADLE = 'Gradle'
    private final static String TOOL_JRE = 'Java'
    private final static String UPDATE_INSTRUCTIONS = 'Update the used %s version to %s or higher to ' +
        'get better (and faster) analysis results.'

    private ToolVersions() {
        throw new AssertionError("ToolVersions can't be instantiated" as Object)
    }

    static String getPmdVersion() {
        if (GradleVersion.current() < GRADLE_VERSION_PMD) {
{'fraction_non_alphanumeric': 0.07345175228036485, 'fraction_numerical': 0.019683149303888623, 'mean_word_length': 4.081707317073171, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1369080', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1188, 'n_words': 435}