diff --git a/.gitignore b/.gitignore
index 52f276a..84dde64 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
+*.log
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
!/.mvn/wrapper/maven-wrapper.jar
@@ -29,4 +30,4 @@ buildNumber.properties
# Ignore IntelliJ files
.idea
*.iml
-.vscode
\ No newline at end of file
+.vscode
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 33ec036..1c01dba 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,25 +1,30 @@
# Contributing to i-Code CNES plugin for SonarQube
First off, thanks for taking the time to contribute!
-The following is a set of guidelines for contributing to i-Code CNES plugin for SonarQube, which are hosted in the [Lequal Organization](https://github.com/lequal) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
+The following is a set of guidelines for contributing to i-Code CNES plugin for SonarQube, which are hosted in the [CATLab organization](https://github.com/cnescatlab) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
#### Table Of Contents
-+ [Code of Conduct](#code-of-conduct)
-+ [How Can I Contribute?](#how-can-i-contribute)
- * [Reporting Bugs](#reporting-bugs)
- * [Suggesting Enhancements](#suggesting-enhancements)
- * [Pull Requests](#pull-requests)
- * [Git Commit Messages](#git-commit-messages)
+- [Contributing to i-Code CNES plugin for SonarQube](#contributing-to-i-code-cnes-plugin-for-sonarqube)
+ - [Table Of Contents](#table-of-contents)
+ - [Code of Conduct](#code-of-conduct)
+ - [How Can I Contribute?](#how-can-i-contribute)
+ - [Reporting Bugs](#reporting-bugs)
+ - [How Do I Submit A (Good) Bug Report?](#how-do-i-submit-a-good-bug-report)
+ - [Suggesting Enhancements](#suggesting-enhancements)
+ - [How Do I Submit A (Good) Enhancement Suggestion?](#how-do-i-submit-a-good-enhancement-suggestion)
+ - [Pull Requests](#pull-requests)
+ - [Git Commit Messages](#git-commit-messages)
+ - [Management of contributions](#management-of-contributions)
## Code of Conduct
-This project and everyone participating in it is governed by the [Lequal Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
+This project and everyone participating in it is governed by the [CATLab Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to us or [GitHub](https://github.com/contact/report-content).
## How Can I Contribute?
### Reporting Bugs
-Before creating bug reports, please check if the problem has already been reported.
+Before creating bug reports, please check if the problem has already been reported.
#### How Do I Submit A (Good) Bug Report?
-Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/).
+Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/).
Provide information by filling [the template](.github/ISSUE_TEMPLATE/bug_report.md).
Explain the problem and include additional details to help maintainers reproduce the problem:
@@ -32,7 +37,7 @@ Explain the problem and include additional details to help maintainers reproduce
Provide more context by answering these questions:
* **Did the problem start happening recently** (e.g. after updating to a new version of the plugin or SonarQube) or was this always a problem?
-* If the problem started happening recently, **can you reproduce the problem in an older version?** What's the most recent version in which the problem doesn't happen? You can download older versions from [the releases page](https://github.com/lequal/sonar-icode-cnes-plugin/releases).
+* If the problem started happening recently, **can you reproduce the problem in an older version?** What's the most recent version in which the problem doesn't happen? You can download older versions from [the releases page](https://github.com/cnescatlab/sonar-icode-cnes-plugin/releases).
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
Include details about your configuration and environment:
@@ -72,8 +77,69 @@ Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com
All contributions are welcome. They are made via a *pull request* on the branch `dev` which is the branch of the next version.
-* pull request with **major** changes must be approved by at least one maintainer of each team and the LEQUAL.
+* pull request with **major** changes must be approved by at least one maintainer of each team and the CATLab.
* pull requests with **minor** changes must be approved by at least one organization's member.
-
+
All maintainers have the ability to merge *pull requests* on the `dev` branch. If several maintainers belong to the same team, their validation only counts for one organization.
+
+# Development
+## How to build
+
+This plugin is mainly developped in Java* and build with maven**. It's main dependencies are [fr.cnes.icode.icode-library](https://github.com/cnescatlab/i-CodeCNES) and libraries for [SonarQube](https://docs.sonarsource.com/sonarqube-community-build/extension-guide/developing-a-plugin/plugin-basics/)
+
+> \* Depending the version, the JDK version is written in the [pom.xml](pom.xml) ans the SonarQube compatibility is in the matrix: [matrix](README.md#run-i-code-automatically)
+>
+> \*\* the build for the release version are validated in maven 3.9.9
+
+
+The icode-library is available on github repository. You'll have to configured your maven settings.xml with a new repository like this:
+
+```xml
+
+
+ github
+ https://maven.pkg.github.com/cnescatlab/*
+
+
+```
+
+For all other dependencies, maven [central](https://central.sonatype.com/) is enough.
+
+After that, you only have to launch the build command:
+
+```bash
+mvn package
+```
+
+The jar will be in the **target** folder.
+
+## How to launch integration test
+
+An integration test is written to validate the plugin in a SonarQube dockerized instance and with a Fortran scan.
+
+** [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/) is needed for this integration test
+
+There is 2 scripts to make the test:
+- The [it.sh](it/it.sh) to launch a SonarQube docker instance and install the local sonar-icode-cnes-plugin-.jar in this instance.
+- the [audit.sh](it/audit.sh) to make a sonar-scanner launch a Fortran 77 and Fortran 90 code in the [src](it/src/) folder. This script check f77 and f90 issues a shown by SonarQube using the API.
+
+
+The it script can use parameters:
+```bash
+$> ./it.sh -h
+
+Usage: ./it.sh [sSh]
+
+-h : Display help
+-s [SONAR-SCANNER] : Take Sonar-scanner tag image from https://hub.docker.com/r/sonarsource/sonar-scanner-cli. Default is the latest tag
+-S [SONARQUBE] : Take SonarQube tag image from https://hub.docker.com/_/sonarqube. Default is the community tag
+```
+
+Example of launching :
+```bash
+cd it
+./it.sh -s 11.4.0.2044_7.2.0 -S lts-community
+```
+
+> Be careful to choose version depending the [compatibility matrix](README.md#run-i-code-automatically)
\ No newline at end of file
diff --git a/README.md b/README.md
index 36b40d3..a709edb 100644
--- a/README.md
+++ b/README.md
@@ -81,7 +81,7 @@ Please report issues at https://github.com/leqcnescatlabual/i-CodeCNES/issues
````
### How to contribute
-If you experienced a problem with the plugin please open an issue. Inside this issue please explain us how to reproduce this issue and paste the log.
+If you experienced a problem with the plugin please open an issue. Inside this issue please explain us how to reproduce this issue and paste the log.
If you want to do a PR, please put inside of it the reason of this pull request. If this pull request fix an issue please insert the number of the issue or explain inside of the PR how to reproduce this issue.
diff --git a/it/Dockerfile-auditor b/it/Dockerfile-auditor
new file mode 100644
index 0000000..e2ef879
--- /dev/null
+++ b/it/Dockerfile-auditor
@@ -0,0 +1,36 @@
+ARG SCANNER_VERSION=latest
+FROM sonarsource/sonar-scanner-cli:${SCANNER_VERSION} AS builder
+
+FROM eclipse-temurin:21-jre-alpine
+
+ARG SONAR_SCANNER_HOME=/opt/sonar-scanner
+ENV HOME=/tmp \
+ SONAR_SCANNER_HOME=${SONAR_SCANNER_HOME} \
+ XDG_CONFIG_HOME=/tmp \
+ SONAR_USER_HOME=${SONAR_SCANNER_HOME}/.sonar \
+ PATH=${SONAR_SCANNER_HOME}/bin:${PATH} \
+ SRC_PATH=/usr/src \
+ LANG=C.UTF-8 \
+ LC_ALL=C.UTF-8 \
+ PYTHONUNBUFFERED=1
+
+WORKDIR /usr/src/myapp/it
+
+USER root
+# Copy Scanner installation from builder image
+COPY --from=builder /opt/sonar-scanner /opt/sonar-scanner
+
+
+RUN apk update --no-cache && \
+ apk add --update --no-cache -q curl gcc jq libffi-dev musl-dev openssl-dev python3 py3-requests shellcheck
+
+RUN set -eux && \
+ addgroup --gid 1000 scanner-cli && \
+ adduser --uid 1000 --ingroup scanner-cli --disabled-password --no-create-home --gecos "" scanner-cli && \
+ mkdir -p "${SRC_PATH}" "${SONAR_USER_HOME}" "${SONAR_USER_HOME}/cache" && \
+ chown -R scanner-cli:scanner-cli "${SONAR_SCANNER_HOME}" "${SRC_PATH}" && \
+ chmod -R 555 "${SONAR_SCANNER_HOME}" && \
+ chmod -R 754 "${SRC_PATH}" "${SONAR_USER_HOME}"
+
+USER scanner-cli
+COPY --chown=scanner-cli:scanner-cli it /usr/src/myapp/it
diff --git a/it/audit.sh b/it/audit.sh
new file mode 100644
index 0000000..2390de2
--- /dev/null
+++ b/it/audit.sh
@@ -0,0 +1,90 @@
+#!/bin/sh -e
+
+# ----------------------------------
+# Colors
+# ----------------------------------
+NOCOLOR='\033[0m'
+RED='\033[0;31m'
+GREEN='\033[0;32m'
+ORANGE='\033[0;33m'
+
+# Function to get value from a property file
+# arg 1 = the property
+# arg 2 = the file path
+function prop {
+ grep "${1}" ${2} | cut -d'=' -f2
+}
+
+# Configure sonar-scanner
+export SONAR_HOST_URL="http://sonarqube:9000"
+export SONAR_ADMIN_LOGIN="admin"
+export SONAR_ADMIN_PWD="admin"
+
+# Generate Analysis token
+echo "Generating analysis token..."
+# Use an UUID for token name. It's useful to launch the audit several time on the same SonarQube execution
+uuid=$(cat /proc/sys/kernel/random/uuid)
+export SONAR_TOKEN=$(curl -su "$SONAR_ADMIN_LOGIN:$SONAR_ADMIN_PWD" -XPOST "$SONAR_HOST_URL/api/user_tokens/generate?name=$uuid&type=GLOBAL_ANALYSIS_TOKEN" | jq -r '.token')
+echo $SONAR_TOKEN
+# Audit code
+echo "Launching scanner..."
+cd /usr/src/myapp/it
+sonar-scanner -X -Dsonar.qualitygate.wait 2>&1 | tee /tmp/scanner.log
+
+if [ $? -ne 0 ]
+then
+ echo "${RED}Error scanning Shell scripts${NOCOLOR}" >&2
+ exit 1
+fi
+
+# Check for warnings
+if grep -q "^WARN: " /tmp/scanner.log
+then
+ echo -e "${ORANGE}Warnings found ${NOCOLOR}" >&2
+ exit 1
+fi
+
+# Sleep a little because SonarQube needs some time to ingest the audit results
+sleep 10
+
+export SONAR_PROJECT_KEY=$(prop 'sonar.projectKey' sonar-project.properties)
+echo "SONAR_PROJECT_KEY: $SONAR_PROJECT_KEY"
+
+# Check audit result
+echo "Checking result..."
+python3 << EOF
+from __future__ import print_function
+import requests
+import sys
+
+r = requests.get('http://sonarqube:9000/api/issues/search?componentKeys=$SONAR_PROJECT_KEY:src/clanhb.f&statuses=OPEN', auth=('$SONAR_ADMIN_LOGIN', '$SONAR_ADMIN_PWD'))
+if r.status_code != 200:
+ print('Invalid server response: ' + str(r.status_code), file=sys.stderr)
+ sys.exit(1)
+
+data = r.json()
+
+if data['total'] != 100:
+ print('Wrong total number of issues: ' + str(data['total']), file=sys.stderr)
+ sys.exit(1)
+
+issues = 0
+if 'f77-rules' in data['issues'][0]['rule'] and data['issues'][0]['line'] == 1:
+ issues += 1
+
+r = requests.get('http://sonarqube:9000/api/issues/search?componentKeys=$SONAR_PROJECT_KEY:src/clanhb.f90&statuses=OPEN', auth=('$SONAR_ADMIN_LOGIN', '$SONAR_ADMIN_PWD'))
+if r.status_code != 200:
+ print('Invalid server response: ' + str(r.status_code), file=sys.stderr)
+ sys.exit(1)
+
+data = r.json()
+
+if data['total'] != 197:
+ print('Wrong total number of issues: ' + str(data['total']), file=sys.stderr)
+ sys.exit(1)
+if 'f90-rules' in data['issues'][0]['rule'] and data['issues'][0]['line'] == 1:
+ issues += 1
+
+
+sys.exit(0 if issues == 2 else 1)
+EOF
diff --git a/it/docker-compose.yml b/it/docker-compose.yml
new file mode 100644
index 0000000..4ed1617
--- /dev/null
+++ b/it/docker-compose.yml
@@ -0,0 +1,23 @@
+---
+services:
+ sonarqube:
+ image: sonarqube:${SONARQUBE_VERSION:-community}
+ ports:
+ - "9000:9000"
+ environment:
+ ES_JAVA_OPTS: "-Xms750m -Xmx750m"
+ SONARQUBE_VERSION: ${SONARQUBE_VERSION:-community}
+ security_opt:
+ - seccomp:unconfined
+ auditor:
+ image: auditor:${SCANNER_VERSION:-latest}
+ build:
+ context: ..
+ dockerfile: it/Dockerfile-auditor
+ args:
+ SCANNER_VERSION: ${SCANNER_VERSION:-latest}
+ links:
+ - sonarqube
+ command: /bin/sh -e /usr/src/myapp/it/audit.sh
+ environment:
+ SCANNER_VERSION: ${SCANNER_VERSION:-latest}
diff --git a/it/it.sh b/it/it.sh
new file mode 100755
index 0000000..3f0973e
--- /dev/null
+++ b/it/it.sh
@@ -0,0 +1,93 @@
+#!/bin/bash
+
+usage(){
+ echo -e "\nUsage: $0 [sSh] \n"
+ echo "-h : Display help"
+ echo "-s [SONAR-SCANNER] : Take Sonar-scanner tag image from https://hub.docker.com/r/sonarsource/sonar-scanner-cli". Default is the latest tag
+ echo "-S [SONARQUBE] : Take SonarQube tag image from https://hub.docker.com/_/sonarqube". Default is the community tag
+}
+
+OPTSTRING=":s:S:h"
+
+while getopts ${OPTSTRING} opt; do
+ case ${opt} in
+ s)
+ export SCANNER_VERSION=$OPTARG
+ ;;
+ S)
+ export SONARQUBE_VERSION=$OPTARG
+ ;;
+ h)
+ usage
+ exit 0
+ ;;
+ :)
+ echo "Option -${OPTARG} requires an argument."
+ usage
+ exit 1
+ ;;
+ ?)
+ echo "Invalid option: -${OPTARG}."
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+
+export SCRIPT_DIR=`dirname $0`
+
+# Clean-up if needed
+echo "Cleanup..."
+docker-compose -f $SCRIPT_DIR/docker-compose.yml down
+
+# Start containers
+echo "Starting SonarQube..."
+docker-compose -f $SCRIPT_DIR/docker-compose.yml up -d sonarqube
+CONTAINER_NAME=$(docker ps --format "{{.Names}}" | grep 'it-sonarqube-1.*' | head -1)
+# Wait for SonarQube to be up
+grep -q "SonarQube is operational" <(docker logs --follow --tail 0 $CONTAINER_NAME)
+echo "SonarQube started!"
+
+# Copy the plugins
+MAVEN_VERSION=$(grep '' $SCRIPT_DIR/../pom.xml | head -1 | sed 's/<\/\?version>//g'| awk '{print $1}')
+echo "Installing the plugin Icode version $MAVEN_VERSION"
+docker cp $SCRIPT_DIR/../target/sonar-icode-cnes-plugin-$MAVEN_VERSION.jar $CONTAINER_NAME:/opt/sonarqube/extensions/plugins
+# Restart SonarQube
+docker-compose -f $SCRIPT_DIR/docker-compose.yml restart sonarqube
+# Wait for SonarQube to be up
+grep -q "SonarQube is operational" <(docker logs --follow --tail 0 $CONTAINER_NAME)
+# Check plug-in installation
+docker exec -u root $CONTAINER_NAME bash -c "if grep -q Alpine /etc/issue; then apk update && apk add -q curl; fi"
+docker exec -u root $CONTAINER_NAME bash -c "if grep -q Ubuntu /etc/issue; then apt-get update && apt-get install -y curl; fi"
+if ! docker exec $CONTAINER_NAME curl -su admin:admin http://localhost:9000/api/plugins/installed | python -c '
+import sys
+import json
+plugins_count = 0
+plugins_expected = ["icode"]
+data = json.loads(sys.stdin.read())
+if "plugins" in data:
+ for plugin in data["plugins"]:
+ if plugin["key"] in plugins_expected:
+ plugins_count += 1
+if plugins_count == len(plugins_expected):
+ sys.exit(0)
+else:
+ sys.exit(1)
+'
+then
+ echo "Plugin not installed" >&2
+ exit 1
+fi
+echo "Plugin successfully installed!"
+
+# Audit code
+echo "Audit test scripts..."
+docker-compose -f $SCRIPT_DIR/docker-compose.yml up --build --exit-code-from auditor auditor
+AUDIT_STATUS=$?
+
+# Delete containers
+echo "Cleanup..."
+docker-compose -f $SCRIPT_DIR/docker-compose.yml down
+
+exit $AUDIT_STATUS
diff --git a/it/sonar-project.properties b/it/sonar-project.properties
new file mode 100644
index 0000000..a75cfbb
--- /dev/null
+++ b/it/sonar-project.properties
@@ -0,0 +1,5 @@
+sonar.projectKey=icode
+sonar.projectName=I-Code
+sonar.projectVersion=1.0
+sonar.sources=src
+sonar.scm.disabled=True
diff --git a/it/src/clanhb.f b/it/src/clanhb.f
new file mode 100644
index 0000000..4ee7209
--- /dev/null
+++ b/it/src/clanhb.f
@@ -0,0 +1,276 @@
+*> \brief \b CLANHB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a Hermitian band matrix.
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+*> \htmlonly
+*> Download CLANHB + dependencies
+*>
+*> [TGZ]
+*>
+*> [ZIP]
+*>
+*> [TXT]
+*> \endhtmlonly
+*
+* Definition:
+* ===========
+*
+* REAL FUNCTION CLANHB( NORM, UPLO, N, K, AB, LDAB,
+* WORK )
+*
+* .. Scalar Arguments ..
+* CHARACTER NORM, UPLO
+* INTEGER K, LDAB, N
+* ..
+* .. Array Arguments ..
+* REAL WORK( * )
+* COMPLEX AB( LDAB, * )
+* ..
+*
+*
+*> \par Purpose:
+* =============
+*>
+*> \verbatim
+*>
+*> CLANHB returns the value of the one norm, or the Frobenius norm, or
+*> the infinity norm, or the element of largest absolute value of an
+*> n by n hermitian band matrix A, with k super-diagonals.
+*> \endverbatim
+*>
+*> \return CLANHB
+*> \verbatim
+*>
+*> CLANHB = ( max(abs(A(i,j))), NORM = 'M' or 'm'
+*> (
+*> ( norm1(A), NORM = '1', 'O' or 'o'
+*> (
+*> ( normI(A), NORM = 'I' or 'i'
+*> (
+*> ( normF(A), NORM = 'F', 'f', 'E' or 'e'
+*>
+*> where norm1 denotes the one norm of a matrix (maximum column sum),
+*> normI denotes the infinity norm of a matrix (maximum row sum) and
+*> normF denotes the Frobenius norm of a matrix (square root of sum of
+*> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
+*> \endverbatim
+*
+* Arguments:
+* ==========
+*
+*> \param[in] NORM
+*> \verbatim
+*> NORM is CHARACTER*1
+*> Specifies the value to be returned in CLANHB as described
+*> above.
+*> \endverbatim
+*>
+*> \param[in] UPLO
+*> \verbatim
+*> UPLO is CHARACTER*1
+*> Specifies whether the upper or lower triangular part of the
+*> band matrix A is supplied.
+*> = 'U': Upper triangular
+*> = 'L': Lower triangular
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0. When N = 0, CLANHB is
+*> set to zero.
+*> \endverbatim
+*>
+*> \param[in] K
+*> \verbatim
+*> K is INTEGER
+*> The number of super-diagonals or sub-diagonals of the
+*> band matrix A. K >= 0.
+*> \endverbatim
+*>
+*> \param[in] AB
+*> \verbatim
+*> AB is COMPLEX array, dimension (LDAB,N)
+*> The upper or lower triangle of the hermitian band matrix A,
+*> stored in the first K+1 rows of AB. The j-th column of A is
+*> stored in the j-th column of the array AB as follows:
+*> if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j;
+*> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+k).
+*> Note that the imaginary parts of the diagonal elements need
+*> not be set and are assumed to be zero.
+*> \endverbatim
+*>
+*> \param[in] LDAB
+*> \verbatim
+*> LDAB is INTEGER
+*> The leading dimension of the array AB. LDAB >= K+1.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is REAL array, dimension (MAX(1,LWORK)),
+*> where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise,
+*> WORK is not referenced.
+*> \endverbatim
+*
+* Authors:
+* ========
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date September 2012
+*
+*> \ingroup complexOTHERauxiliary
+*
+* =====================================================================
+ REAL FUNCTION CLANHB( NORM, UPLO, N, K, AB, LDAB,
+ $ WORK )
+*
+* -- LAPACK auxiliary routine (version 3.4.2) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* September 2012
+*
+* .. Scalar Arguments ..
+ CHARACTER NORM, UPLO
+ INTEGER K, LDAB, N
+* ..
+* .. Array Arguments ..
+ REAL WORK( * )
+ COMPLEX AB( LDAB, * )
+* ..
+*
+* =====================================================================
+*
+* .. Parameters ..
+ REAL ONE, ZERO
+ PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
+* ..
+* .. Local Scalars ..
+ INTEGER I, J, L
+ REAL ABSA, SCALE, SUM, VALUE
+* ..
+* .. External Functions ..
+ LOGICAL LSAME, SISNAN
+ EXTERNAL LSAME, SISNAN
+* ..
+* .. External Subroutines ..
+ EXTERNAL CLASSQ
+* ..
+* .. Intrinsic Functions ..
+ INTRINSIC ABS, MAX, MIN, REAL, SQRT
+* ..
+* .. Executable Statements ..
+*
+ IF( N.EQ.0 ) THEN
+ VALUE = ZERO
+ ELSE IF( LSAME( NORM, 'M' ) ) THEN
+*
+* Find max(abs(A(i,j))).
+*
+ VALUE = ZERO
+ IF( LSAME( UPLO, 'U' ) ) THEN
+ DO 20 J = 1, N
+ DO 10 I = MAX( K+2-J, 1 ), K
+ SUM = ABS( AB( I, J ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ 10 CONTINUE
+ SUM = ABS( REAL( AB( K+1, J ) ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ 20 CONTINUE
+ ELSE
+ DO 40 J = 1, N
+ SUM = ABS( REAL( AB( 1, J ) ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ DO 30 I = 2, MIN( N+1-J, K+1 )
+ SUM = ABS( AB( I, J ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ 30 CONTINUE
+ 40 CONTINUE
+ END IF
+ ELSE IF( ( LSAME( NORM, 'I' ) ) .OR. ( LSAME( NORM, 'O' ) ) .OR.
+ $ ( NORM.EQ.'1' ) ) THEN
+*
+* Find normI(A) ( = norm1(A), since A is hermitian).
+*
+ VALUE = ZERO
+ IF( LSAME( UPLO, 'U' ) ) THEN
+ DO 60 J = 1, N
+ SUM = ZERO
+ L = K + 1 - J
+ DO 50 I = MAX( 1, J-K ), J - 1
+ ABSA = ABS( AB( L+I, J ) )
+ SUM = SUM + ABSA
+ WORK( I ) = WORK( I ) + ABSA
+ 50 CONTINUE
+ WORK( J ) = SUM + ABS( REAL( AB( K+1, J ) ) )
+ 60 CONTINUE
+ DO 70 I = 1, N
+ SUM = WORK( I )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ 70 CONTINUE
+ ELSE
+ DO 80 I = 1, N
+ WORK( I ) = ZERO
+ 80 CONTINUE
+ DO 100 J = 1, N
+ SUM = WORK( J ) + ABS( REAL( AB( 1, J ) ) )
+ L = 1 - J
+ DO 90 I = J + 1, MIN( N, J+K )
+ ABSA = ABS( AB( L+I, J ) )
+ SUM = SUM + ABSA
+ WORK( I ) = WORK( I ) + ABSA
+ 90 CONTINUE
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ 100 CONTINUE
+ END IF
+ ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
+*
+* Find normF(A).
+*
+ SCALE = ZERO
+ SUM = ONE
+ IF( K.GT.0 ) THEN
+ IF( LSAME( UPLO, 'U' ) ) THEN
+ DO 110 J = 2, N
+ CALL CLASSQ( MIN( J-1, K ), AB( MAX( K+2-J, 1 ), J ),
+ $ 1, SCALE, SUM )
+ 110 CONTINUE
+ L = K + 1
+ ELSE
+ DO 120 J = 1, N - 1
+ CALL CLASSQ( MIN( N-J, K ), AB( 2, J ), 1, SCALE,
+ $ SUM )
+ 120 CONTINUE
+ L = 1
+ END IF
+ SUM = 2*SUM
+ ELSE
+ L = 1
+ END IF
+ DO 130 J = 1, N
+ IF( REAL( AB( L, J ) ).NE.ZERO ) THEN
+ ABSA = ABS( REAL( AB( L, J ) ) )
+ IF( SCALE.LT.ABSA ) THEN
+ SUM = ONE + SUM*( SCALE / ABSA )**2
+ SCALE = ABSA
+ ELSE
+ SUM = SUM + ( ABSA / SCALE )**2
+ END IF
+ END IF
+ 130 CONTINUE
+ VALUE = SCALE*SQRT( SUM )
+ END IF
+*
+ CLANHB = VALUE
+ RETURN
+*
+* End of CLANHB
+*
+ END
diff --git a/it/src/clanhb.f90 b/it/src/clanhb.f90
new file mode 100644
index 0000000..4ee7209
--- /dev/null
+++ b/it/src/clanhb.f90
@@ -0,0 +1,276 @@
+*> \brief \b CLANHB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a Hermitian band matrix.
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+*> \htmlonly
+*> Download CLANHB + dependencies
+*>
+*> [TGZ]
+*>
+*> [ZIP]
+*>
+*> [TXT]
+*> \endhtmlonly
+*
+* Definition:
+* ===========
+*
+* REAL FUNCTION CLANHB( NORM, UPLO, N, K, AB, LDAB,
+* WORK )
+*
+* .. Scalar Arguments ..
+* CHARACTER NORM, UPLO
+* INTEGER K, LDAB, N
+* ..
+* .. Array Arguments ..
+* REAL WORK( * )
+* COMPLEX AB( LDAB, * )
+* ..
+*
+*
+*> \par Purpose:
+* =============
+*>
+*> \verbatim
+*>
+*> CLANHB returns the value of the one norm, or the Frobenius norm, or
+*> the infinity norm, or the element of largest absolute value of an
+*> n by n hermitian band matrix A, with k super-diagonals.
+*> \endverbatim
+*>
+*> \return CLANHB
+*> \verbatim
+*>
+*> CLANHB = ( max(abs(A(i,j))), NORM = 'M' or 'm'
+*> (
+*> ( norm1(A), NORM = '1', 'O' or 'o'
+*> (
+*> ( normI(A), NORM = 'I' or 'i'
+*> (
+*> ( normF(A), NORM = 'F', 'f', 'E' or 'e'
+*>
+*> where norm1 denotes the one norm of a matrix (maximum column sum),
+*> normI denotes the infinity norm of a matrix (maximum row sum) and
+*> normF denotes the Frobenius norm of a matrix (square root of sum of
+*> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
+*> \endverbatim
+*
+* Arguments:
+* ==========
+*
+*> \param[in] NORM
+*> \verbatim
+*> NORM is CHARACTER*1
+*> Specifies the value to be returned in CLANHB as described
+*> above.
+*> \endverbatim
+*>
+*> \param[in] UPLO
+*> \verbatim
+*> UPLO is CHARACTER*1
+*> Specifies whether the upper or lower triangular part of the
+*> band matrix A is supplied.
+*> = 'U': Upper triangular
+*> = 'L': Lower triangular
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0. When N = 0, CLANHB is
+*> set to zero.
+*> \endverbatim
+*>
+*> \param[in] K
+*> \verbatim
+*> K is INTEGER
+*> The number of super-diagonals or sub-diagonals of the
+*> band matrix A. K >= 0.
+*> \endverbatim
+*>
+*> \param[in] AB
+*> \verbatim
+*> AB is COMPLEX array, dimension (LDAB,N)
+*> The upper or lower triangle of the hermitian band matrix A,
+*> stored in the first K+1 rows of AB. The j-th column of A is
+*> stored in the j-th column of the array AB as follows:
+*> if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j;
+*> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+k).
+*> Note that the imaginary parts of the diagonal elements need
+*> not be set and are assumed to be zero.
+*> \endverbatim
+*>
+*> \param[in] LDAB
+*> \verbatim
+*> LDAB is INTEGER
+*> The leading dimension of the array AB. LDAB >= K+1.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is REAL array, dimension (MAX(1,LWORK)),
+*> where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise,
+*> WORK is not referenced.
+*> \endverbatim
+*
+* Authors:
+* ========
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date September 2012
+*
+*> \ingroup complexOTHERauxiliary
+*
+* =====================================================================
+ REAL FUNCTION CLANHB( NORM, UPLO, N, K, AB, LDAB,
+ $ WORK )
+*
+* -- LAPACK auxiliary routine (version 3.4.2) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* September 2012
+*
+* .. Scalar Arguments ..
+ CHARACTER NORM, UPLO
+ INTEGER K, LDAB, N
+* ..
+* .. Array Arguments ..
+ REAL WORK( * )
+ COMPLEX AB( LDAB, * )
+* ..
+*
+* =====================================================================
+*
+* .. Parameters ..
+ REAL ONE, ZERO
+ PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
+* ..
+* .. Local Scalars ..
+ INTEGER I, J, L
+ REAL ABSA, SCALE, SUM, VALUE
+* ..
+* .. External Functions ..
+ LOGICAL LSAME, SISNAN
+ EXTERNAL LSAME, SISNAN
+* ..
+* .. External Subroutines ..
+ EXTERNAL CLASSQ
+* ..
+* .. Intrinsic Functions ..
+ INTRINSIC ABS, MAX, MIN, REAL, SQRT
+* ..
+* .. Executable Statements ..
+*
+ IF( N.EQ.0 ) THEN
+ VALUE = ZERO
+ ELSE IF( LSAME( NORM, 'M' ) ) THEN
+*
+* Find max(abs(A(i,j))).
+*
+ VALUE = ZERO
+ IF( LSAME( UPLO, 'U' ) ) THEN
+ DO 20 J = 1, N
+ DO 10 I = MAX( K+2-J, 1 ), K
+ SUM = ABS( AB( I, J ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ 10 CONTINUE
+ SUM = ABS( REAL( AB( K+1, J ) ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ 20 CONTINUE
+ ELSE
+ DO 40 J = 1, N
+ SUM = ABS( REAL( AB( 1, J ) ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ DO 30 I = 2, MIN( N+1-J, K+1 )
+ SUM = ABS( AB( I, J ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ 30 CONTINUE
+ 40 CONTINUE
+ END IF
+ ELSE IF( ( LSAME( NORM, 'I' ) ) .OR. ( LSAME( NORM, 'O' ) ) .OR.
+ $ ( NORM.EQ.'1' ) ) THEN
+*
+* Find normI(A) ( = norm1(A), since A is hermitian).
+*
+ VALUE = ZERO
+ IF( LSAME( UPLO, 'U' ) ) THEN
+ DO 60 J = 1, N
+ SUM = ZERO
+ L = K + 1 - J
+ DO 50 I = MAX( 1, J-K ), J - 1
+ ABSA = ABS( AB( L+I, J ) )
+ SUM = SUM + ABSA
+ WORK( I ) = WORK( I ) + ABSA
+ 50 CONTINUE
+ WORK( J ) = SUM + ABS( REAL( AB( K+1, J ) ) )
+ 60 CONTINUE
+ DO 70 I = 1, N
+ SUM = WORK( I )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ 70 CONTINUE
+ ELSE
+ DO 80 I = 1, N
+ WORK( I ) = ZERO
+ 80 CONTINUE
+ DO 100 J = 1, N
+ SUM = WORK( J ) + ABS( REAL( AB( 1, J ) ) )
+ L = 1 - J
+ DO 90 I = J + 1, MIN( N, J+K )
+ ABSA = ABS( AB( L+I, J ) )
+ SUM = SUM + ABSA
+ WORK( I ) = WORK( I ) + ABSA
+ 90 CONTINUE
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
+ 100 CONTINUE
+ END IF
+ ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
+*
+* Find normF(A).
+*
+ SCALE = ZERO
+ SUM = ONE
+ IF( K.GT.0 ) THEN
+ IF( LSAME( UPLO, 'U' ) ) THEN
+ DO 110 J = 2, N
+ CALL CLASSQ( MIN( J-1, K ), AB( MAX( K+2-J, 1 ), J ),
+ $ 1, SCALE, SUM )
+ 110 CONTINUE
+ L = K + 1
+ ELSE
+ DO 120 J = 1, N - 1
+ CALL CLASSQ( MIN( N-J, K ), AB( 2, J ), 1, SCALE,
+ $ SUM )
+ 120 CONTINUE
+ L = 1
+ END IF
+ SUM = 2*SUM
+ ELSE
+ L = 1
+ END IF
+ DO 130 J = 1, N
+ IF( REAL( AB( L, J ) ).NE.ZERO ) THEN
+ ABSA = ABS( REAL( AB( L, J ) ) )
+ IF( SCALE.LT.ABSA ) THEN
+ SUM = ONE + SUM*( SCALE / ABSA )**2
+ SCALE = ABSA
+ ELSE
+ SUM = SUM + ( ABSA / SCALE )**2
+ END IF
+ END IF
+ 130 CONTINUE
+ VALUE = SCALE*SQRT( SUM )
+ END IF
+*
+ CLANHB = VALUE
+ RETURN
+*
+* End of CLANHB
+*
+ END
diff --git a/pom.xml b/pom.xml
index 0e5c0a1..24a24a5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,12 +1,13 @@
-
+4.0.0fr.cnes.sonar.pluginssonar-icode-cnes-pluginsonar-plugin
- 5.1.0
+ 5.2.0-SNAPSHOTSonar i-Code CNES plugin
@@ -56,21 +57,13 @@
UTF-8
- 17
- 17
- 1717
- 17
- 9.8.0.203
- 9.5.0.56709
- 9.9.1.69595
- 2.6.1
- 1.21.0.505
- 3.7
- 2.8.2
- 1.7.25
- 4.13.2
- 0.8.10
+ 23
+ 17
+ 3.5.3
+
+ 9.14.0.375
+ 9.9.0.65466icodefr.cnes.sonar.plugins.icode.ICodePluginhttps://github.com/cnescatlab/sonar-icode-cnes-plugin
@@ -98,35 +91,35 @@
org.sonarsource.api.pluginsonar-plugin-api
- ${sonar.apiVersion}
+ ${sonar.plugin.api.version}providedfr.cnes.icodeicode-library5.1.0
-
+
- commons-lang
- commons-lang
- 2.6
+ org.apache.commons
+ commons-lang3
+ 3.17.0
-
+
org.sonarsource.sonarqubesonar-plugin-api-impl
- ${sonar.apiImplVersion}
+ ${sonar.version}junitjunit
- 4.11
+ 4.13.2test
@@ -138,48 +131,80 @@
com.thoughtworks.xstreamxstream
- 1.4.18
+ 1.4.21
+
+
+
+ org.apache.maven.plugins
+ maven-clean-plugin
+ 3.4.1
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ 3.3.1
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.14.0
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ ${surefire.version}
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ 0.8.13
+
+
+ org.apache.maven.plugins
+ maven-install-plugin
+ 3.1.4
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ 3.1.4
+
+
+ org.sonarsource.sonar-packaging-maven-plugin
+ sonar-packaging-maven-plugin
+ 1.23.0.740
+
+
+ org.apache.maven.plugins
+ maven-project-info-reports-plugin
+ 2.9
+
+
+ org.sonarsource.sonar-packaging-maven-pluginsonar-packaging-maven-plugin
- ${sonar-packaging-maven-plugin.version}trueorg.apache.maven.pluginsmaven-compiler-plugin
- 3.10.1${jdk.min.version}${jdk.min.version}
-
-
- org.codehaus.mojo
- native2ascii-maven-plugin
- 2.0.1
-
-
-
- resources
-
-
-
-
-
org.apache.maven.pluginsmaven-project-info-reports-plugin
- 2.9false
@@ -188,12 +213,11 @@
org.apache.maven.pluginsmaven-surefire-plugin
- 3.0.0-M4org.apache.maven.surefiresurefire-junit47
- 3.0.0-M4
+ ${surefire.version}
@@ -201,7 +225,6 @@
org.jacocojacoco-maven-plugin
- ${jacoco.version}prepare-agent
@@ -234,15 +257,4 @@
-
-
-
-
-
- junit
- junit
- ${junit.version}
-
-
-