diff --git a/.gitignore b/.gitignore index c507849..eb0d60a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,73 @@ -target -.idea +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +.idea/modules.xml +.idea/*.iml +.idea/modules +*.iml +*.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +.idea/* +*.iml + +target/ \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index b194ae1..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index b26911b..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_guava_guava_18_0.xml b/.idea/libraries/Maven__com_google_guava_guava_18_0.xml deleted file mode 100644 index bbd71d7..0000000 --- a/.idea/libraries/Maven__com_google_guava_guava_18_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_0_0_beta_2.xml b/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_0_0_beta_2.xml deleted file mode 100644 index 0370413..0000000 --- a/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_0_0_beta_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml b/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml deleted file mode 100644 index f3f3738..0000000 --- a/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_io_commons_io_2_4.xml b/.idea/libraries/Maven__commons_io_commons_io_2_4.xml deleted file mode 100644 index bc2aad0..0000000 --- a/.idea/libraries/Maven__commons_io_commons_io_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml b/.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml deleted file mode 100644 index 2ec8376..0000000 --- a/.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__javax_xml_stream_stax_api_1_0_2.xml b/.idea/libraries/Maven__javax_xml_stream_stax_api_1_0_2.xml deleted file mode 100644 index 2a4dd7a..0000000 --- a/.idea/libraries/Maven__javax_xml_stream_stax_api_1_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__jaxen_jaxen_1_1_4.xml b/.idea/libraries/Maven__jaxen_jaxen_1_1_4.xml deleted file mode 100644 index d84dbcf..0000000 --- a/.idea/libraries/Maven__jaxen_jaxen_1_1_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__junit_junit_4_11.xml b/.idea/libraries/Maven__junit_junit_4_11.xml deleted file mode 100644 index f33320d..0000000 --- a/.idea/libraries/Maven__junit_junit_4_11.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_codehaus_sonar_sslr_sslr_xpath_1_20.xml b/.idea/libraries/Maven__org_codehaus_sonar_sslr_sslr_xpath_1_20.xml deleted file mode 100644 index 40137b0..0000000 --- a/.idea/libraries/Maven__org_codehaus_sonar_sslr_sslr_xpath_1_20.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_codehaus_staxmate_staxmate_2_0_1.xml b/.idea/libraries/Maven__org_codehaus_staxmate_staxmate_2_0_1.xml deleted file mode 100644 index cd58567..0000000 --- a/.idea/libraries/Maven__org_codehaus_staxmate_staxmate_2_0_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_codehaus_woodstox_stax2_api_3_1_4.xml b/.idea/libraries/Maven__org_codehaus_woodstox_stax2_api_3_1_4.xml deleted file mode 100644 index b510642..0000000 --- a/.idea/libraries/Maven__org_codehaus_woodstox_stax2_api_3_1_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_codehaus_woodstox_woodstox_core_lgpl_4_4_0.xml b/.idea/libraries/Maven__org_codehaus_woodstox_woodstox_core_lgpl_4_4_0.xml deleted file mode 100644 index c5ded28..0000000 --- a/.idea/libraries/Maven__org_codehaus_woodstox_woodstox_core_lgpl_4_4_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml deleted file mode 100644 index f58bbc1..0000000 --- a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_5_6.xml b/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_5_6.xml deleted file mode 100644 index 3b3e1bf..0000000 --- a/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_5_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_6.xml b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_6.xml deleted file mode 100644 index b92b869..0000000 --- a/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_sonarsource_sslr_squid_bridge_sslr_squid_bridge_2_6_1.xml b/.idea/libraries/Maven__org_sonarsource_sslr_squid_bridge_sslr_squid_bridge_2_6_1.xml deleted file mode 100644 index 9065ab6..0000000 --- a/.idea/libraries/Maven__org_sonarsource_sslr_squid_bridge_sslr_squid_bridge_2_6_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index df553a4..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.8 - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index a53c384..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index fe69d0c..4c2e5c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ addons: organization: "lequal" jdk: - - oraclejdk8 + - openjdk8 script: - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar diff --git a/README.md b/README.md index 0261ea6..b5cbb6a 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ This plugin is free software; you can redistribute it and/or modify it under the 1.2.1 2.0.0 2.1.0 + 2.2.0 1.0.0 @@ -43,6 +44,7 @@ This plugin is free software; you can redistribute it and/or modify it under the x - - + - 1.1.0 @@ -51,6 +53,7 @@ This plugin is free software; you can redistribute it and/or modify it under the x - - + - 1.2.0 @@ -59,6 +62,7 @@ This plugin is free software; you can redistribute it and/or modify it under the x - - + - 1.3.0 @@ -67,6 +71,16 @@ This plugin is free software; you can redistribute it and/or modify it under the - x x + - + + + 1.4.0 + - + - + - + - + - + x diff --git a/pom.xml b/pom.xml index 87c5331..1f1d898 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ fr.cnes.sonar.plugins.scan sonar-cnes-scan-plugin sonar-plugin - 1.3 + 1.4 SonarQube CNES Scan Plugin CNES plugin for SonarQube that launches analysis directly from the web interface and export reports. @@ -40,6 +40,13 @@ CNES https://cnes.fr/ + + louisjdmartin + Louis Martin + louis.jd.martin@gmail.com + CNES + https://cnes.fr/ + diff --git a/src/main/java/fr/cnes/sonar/plugins/scan/web/CnesPluginPageDefinition.java b/src/main/java/fr/cnes/sonar/plugins/scan/web/CnesPluginPageDefinition.java index a3ce62e..3c567a8 100644 --- a/src/main/java/fr/cnes/sonar/plugins/scan/web/CnesPluginPageDefinition.java +++ b/src/main/java/fr/cnes/sonar/plugins/scan/web/CnesPluginPageDefinition.java @@ -46,16 +46,6 @@ public void define(final Context context) { context.addPage(page.build()); - // create a page - page = Page.builder(StringManager.string(StringManager.CNES_PAGE_REPORT_KEY)); - // set its name - page.setName(StringManager.string(StringManager.CNES_PAGE_REPORT_NAME)); - // set its scope (where it is displayed) - page.setScope(Scope.GLOBAL); - // add a new page for reporting - context.addPage(page.build()); - - // create a page page = Page.builder(StringManager.string(StringManager.CNES_PAGE_HELP_KEY)); // set its name diff --git a/src/main/resources/static/analysis.js b/src/main/resources/static/analysis.js index eec13fd..e5136be 100644 --- a/src/main/resources/static/analysis.js +++ b/src/main/resources/static/analysis.js @@ -37,12 +37,17 @@ window.registerExtension('cnesscan/analysis', function (options) { logging.scrollTop = logging.scrollHeight; }; + var displayLog = function (string,color){ + $('#last_log').html("
"+string+"
") + } + /** * Log information in the bottom text area as info * @param string Text to log */ var info = function (string) { log("[INFO] "+string) + displayLog(string,"blue") }; /** @@ -51,6 +56,7 @@ window.registerExtension('cnesscan/analysis', function (options) { */ var error = function (string) { log("[ERROR] "+string) + displayLog(string,"red") }; /** @@ -205,7 +211,8 @@ window.registerExtension('cnesscan/analysis', function (options) { setEnabled(true); }).catch(function (response) { // log error - error("Project report generation failed."); + error("Project report generation failed. \n" + response.logs); + displayLog("Project report generation failed. Please check logs. The project results are still available in the dashboard.","orange") // unlock form setEnabled(true); }); @@ -373,6 +380,7 @@ window.registerExtension('cnesscan/analysis', function (options) { // log the finally used spp info("Here comes the finally used sonar-project.properties:\n" + spp); + info("The analysis is running, please wait."); // send post request to the cnes web service window.SonarRequest.postJSON( @@ -621,6 +629,15 @@ window.registerExtension('cnesscan/analysis', function (options) { return false; } + // get copy button in the DOM + var logButton = document.querySelector('#show_logs'); + // set copy button action + logButton.onclick = function () { + $('#logging, #copy, #show_logs').toggle(); + + return false; + } + // fill out quality gate drop down list initQualityGateDropDownList(); diff --git a/src/main/resources/static/reporting.js b/src/main/resources/static/reporting.js deleted file mode 100644 index b20397a..0000000 --- a/src/main/resources/static/reporting.js +++ /dev/null @@ -1,185 +0,0 @@ -/* - * This file is part of cnesscan. - * - * cnesscan is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * cnesscan is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with cnesscan. If not, see . - */ - -window.registerExtension('cnesscan/reporting', function (options) { - // let's create a flag telling if the page is still displayed - var isDisplayedReporting = true; - - /** - * Log information in the bottom text area - * @param string Text to log - */ - var log = function (string) { - // get the logging element - var logging = document.querySelector('#logging'); - // append text to log - logging.innerHTML = logging.innerHTML + "\n" + string; - // scroll to bottom - logging.scrollTop = logging.scrollHeight; - }; - - /** - * Verify that the fields are correct. - * @returns {boolean} true if all is good - */ - var checkForm = function () { - // check the field key - // get it - var key = document.forms["generation-form"]["key"].value; - // check if void - if (key === "") { - // log error - log("Key must be filled out."); - // abort the process - return false; - } - - return true; - }; - - /** - * Clear log information in text area - */ - var clearLog = function () { - // get the logging element - var logging = document.querySelector('#logging'); - // set initial text to log - logging.innerHTML = "## Logging console ##"; - }; - - /** - * Lock or unlock the form - * @param isEnabled true to unlock, false to lock the form - */ - var setEnabled = function (isEnabled) { - // retrieve the form - var form = document.getElementById("generation-form"); - // get all the components of the form - var elements = form.elements; - // change all components readOnly field to (un)lock them - for (var i = 0, len = elements.length; i < len; i++) { - elements[i].readOnly = !isEnabled; - elements[i].disabled = !isEnabled; - } - - if(isEnabled) { - // hide loading when button are enabled - $('#loading').hide(); - } else { - // show loading otherwise - $('#loading').show(); - } - }; - - /** - * Generate the report - * @param key - * @param author - */ - var produceReport = function (key, author) { - // http GET request to the cnes web service - window.SonarRequest.getJSON( - '/api/cnes/report', - { key: key, author: author } - ).then(function (response) { - // on success log generation - log("[INFO] Project report generation response: \n" + response.logs); - log("############################################################\n\tGeneration of the report terminated!\n############################################################\n"); - setEnabled(true); - }).catch(function (error) { - // log error - log("[ERROR] Project report generation failed."); - setEnabled(true); - }); - }; - - /** - * Get projects list from the server and fill out the combo box - */ - var initProjectsDropDownList = function() { - window.SonarRequest.getJSON( - '/api/projects/index' - ).then(function (response) { - // on success - // we put each quality gate in the list - $.each(response, function (i, item) { - // we create a new option for each quality gate - // in the json response - var option = $('