diff --git a/metrics/ast.py b/metrics/ast.py index 3fe232ee..71b6de88 100755 --- a/metrics/ast.py +++ b/metrics/ast.py @@ -440,69 +440,69 @@ class NotClassError(Exception): if not (tree_class := list((value for value in tree))): raise NotClassError('This is not a class') with open(metrics, 'a', encoding='utf-8') as metric: - metric.write(f'nooa {attrs(tree_class)} ' + metric.write(f'NoOA {attrs(tree_class)} ' f'Number of Non-Static (Object) Attributes\n') - metric.write(f'nosa {sattrs(tree_class)} ' + metric.write(f'NoSA {sattrs(tree_class)} ' f'Number of Static Attributes\n') - metric.write(f'nocc {ctors(tree_class)} ' + metric.write(f'NoCC {ctors(tree_class)} ' f'Number of Class Constructors\n') - metric.write(f'noom {methods(tree_class)} ' + metric.write(f'NoOM {methods(tree_class)} ' f'Number of Non-Static (Object) Methods\n') - metric.write(f'nocm {smethods(tree_class)} ' + metric.write(f'NoCM {smethods(tree_class)} ' f'Number of Static (Class) Methods\n') - metric.write(f'ncss {ncss(raw)} ' + metric.write(f'NCSS {ncss(raw)} ' f'Non-Commenting Source Statements (NCSS)\n') - metric.write(f'noii {impls(tree_class)} ' + metric.write(f'NoII {impls(tree_class)} ' f'Number of Implemented Interfaces\n') - metric.write(f'napc {extnds(tree_class)} ' + metric.write(f'NAPC {extnds(tree_class)} ' f'Number of Ancestor (Parent) Classes\n') - metric.write(f'notp {gnrcs(tree_class)} ' + metric.write(f'NoTP {gnrcs(tree_class)} ' f'Number of Type Parameters (Generics)\n') - metric.write(f'final {final(tree_class)} ' + metric.write(f'Final {final(tree_class)} ' f'Class is ``final\'\' (1) or not (0)\n') - metric.write(f'noca {annts(tree_class)} ' + metric.write(f'NoCA {annts(tree_class)} ' f'Number of Class Annotations\n') - metric.write(f'pvn {pvn(tree_class)} ' + metric.write(f'PVN {pvn(tree_class)} ' f'Average number of parts in variable names\n') - metric.write(f'mxpvn {mxpvn(tree_class)} ' + metric.write(f'MxPVN {mxpvn(tree_class)} ' f'Maximum number of parts in variable names\n') - metric.write(f'mnpvn {mnpvn(tree_class)} ' + metric.write(f'MnPVN {mnpvn(tree_class)} ' f'Minimum number of parts in variable names\n') - metric.write(f'pcn {pcn(tree_class)} ' + metric.write(f'PCN {pcn(tree_class)} ' f'Number of words in the name of a class\n') - metric.write(f'mhf {mhf(tree_class)} ' + metric.write(f'MHF {mhf(tree_class)} ' f'Method Hiding Factor (MHF), which is the ratio of private \ and protected methods to total methods\n') - metric.write(f'smhf {smhf(tree_class)} ' + metric.write(f'SMHF {smhf(tree_class)} ' f'Static Method Hiding Factor (MHF), which is the ratio of private \ and protected static methods to total static methods\n') - metric.write(f'ahf {ahf(tree_class)} ' + metric.write(f'AHF {ahf(tree_class)} ' f'Attribute Hiding Factor (AHF), which is the ratio of private \ and protected attributes to total attributes\n') - metric.write(f'sahf {sahf(tree_class)} ' + metric.write(f'SAHF {sahf(tree_class)} ' f'Static Attribute Hiding Factor (SAHF), which is the ratio of private \ and protected static attributes to total static attributes\n') - metric.write(f'nomp {nomp(tree_class)} ' + metric.write(f'NoMP {nomp(tree_class)} ' f'Number of Method Parameters (NOMP), which is the count of \ all parameters in all methods in a class\n') - metric.write(f'nosmp {nosmp(tree_class)} ' + metric.write(f'NoSMP {nosmp(tree_class)} ' f'Number of Static Method Parameters (NOSMP), which is the count of all \ parameters in all static methods in a class\n') - metric.write(f'mxnomp {mxnomp(tree_class)} ' + metric.write(f'MxNOMP {mxnomp(tree_class)} ' f'Maximum of Method Parameters (MxNOMP), which is the largest amount \ of parameters in some method in a class\n') - metric.write(f'mxnosmp {mxnosmp(tree_class)} ' + metric.write(f'MxNOSMP {mxnosmp(tree_class)} ' f'Maximum of Static Method Parameters (MxNOSMP), which is the largest \ amount of parameters in some static method in a class\n') - metric.write(f'nom {nom(tree_class)} ' + metric.write(f'NOM {nom(tree_class)} ' f'Number of Overriding Methods (NOM), which is the number of methods \ with the \\texttt{{@Override}} annotation\n') - metric.write(f'nop {nop(tree_class)} ' + metric.write(f'NOP {nop(tree_class)} ' f'Number of Polymorphic Methods (NOP), which is the count of methods \ that are overloaded at least once --- have similar names but different parameters\n') - metric.write(f'nulls {nulls(tree_class)} ' + metric.write(f'NULLs {nulls(tree_class)} ' f'Number of NULL References\n') - metric.write(f'doer {doer(tree_class)} ' + metric.write(f'DOER {doer(tree_class)} ' f'Data vs Object Encapsulation Ratio\n') except FileNotFoundError as exception: message = f"{type(exception).__name__} {str(exception)}: {java}" diff --git a/metrics/authors.sh b/metrics/authors.sh index a828cd00..0941a138 100755 --- a/metrics/authors.sh +++ b/metrics/authors.sh @@ -35,4 +35,4 @@ else noca=0 fi -echo "noga ${noca} Number of unique Git committers of a file" > "${output}" +echo "NoGA ${noca} Number of unique Git committers of a file" > "${output}" diff --git a/metrics/cloc.sh b/metrics/cloc.sh index f476431d..a2fe3024 100755 --- a/metrics/cloc.sh +++ b/metrics/cloc.sh @@ -30,7 +30,7 @@ output=$2 out=$(cloc --timeout 0 --quiet --csv "${java}" | tail -1) IFS=',' read -r -a M <<< "${out}" cat < "${output}" -nobl ${M[2]} Number of Blank Lines -nocl ${M[3]} Number of Commenting Lines -loc ${M[4]} Total physical lines of source code, including commenting lines and blank lines +NoBL ${M[2]} Number of Blank Lines +NoCL ${M[3]} Number of Commenting Lines +LoC ${M[4]} Total physical lines of source code, including commenting lines and blank lines EOT diff --git a/metrics/cyclomatic_complexity.py b/metrics/cyclomatic_complexity.py index 2923f53e..2c312e6d 100755 --- a/metrics/cyclomatic_complexity.py +++ b/metrics/cyclomatic_complexity.py @@ -61,7 +61,7 @@ def branches(parser_class: tree.CompilationUnit) -> int: for path, node in ast: complexity += branches(node) with open(metrics, 'a', encoding='utf-8') as m: - m.write(f'cc {complexity} Total \ + m.write(f'CC {complexity} Total \ \\href{{https://en.wikipedia.org/wiki/Cyclomatic_complexity}}{{Cyclomatic Complexity}} \ of all methods\n') except FileNotFoundError as exception: diff --git a/metrics/multimetric.sh b/metrics/multimetric.sh index c98b565e..d0d2013f 100755 --- a/metrics/multimetric.sh +++ b/metrics/multimetric.sh @@ -33,9 +33,9 @@ temp="${TARGET}/temp/multimetric.json" mkdir -p "$(dirname "${temp}")" echo "${body}" > "${temp}" cat < "${output}" -hsd $(echo "${body}" | jq '.halstead_difficulty' | "${LOCAL}/help/float.sh") \href{https://en.wikipedia.org/wiki/Halstead_complexity_measures}{Halstead Difficulty} -hse $(echo "${body}" | jq '.halstead_effort' | "${LOCAL}/help/float.sh") \href{https://en.wikipedia.org/wiki/Halstead_complexity_measures}{Halstead Effort} -hsv $(echo "${body}" | jq '.halstead_volume' | "${LOCAL}/help/float.sh") \href{https://en.wikipedia.org/wiki/Halstead_complexity_measures}{Halstead Volume} -midx $(echo "${body}" | jq '.maintainability_index' | "${LOCAL}/help/float.sh") \href{https://ieeexplore.ieee.org/abstract/document/303623/}{Maintainability Index} -fout $(echo "${body}" | jq '.fanout_external' | "${LOCAL}/help/float.sh") \href{https://en.wikipedia.org/wiki/Fan-out_(software)}{Fan-Out} +HSD $(echo "${body}" | jq '.halstead_difficulty' | "${LOCAL}/help/float.sh") \href{https://en.wikipedia.org/wiki/Halstead_complexity_measures}{Halstead Difficulty} +HSE $(echo "${body}" | jq '.halstead_effort' | "${LOCAL}/help/float.sh") \href{https://en.wikipedia.org/wiki/Halstead_complexity_measures}{Halstead Effort} +HSV $(echo "${body}" | jq '.halstead_volume' | "${LOCAL}/help/float.sh") \href{https://en.wikipedia.org/wiki/Halstead_complexity_measures}{Halstead Volume} +MIdx $(echo "${body}" | jq '.maintainability_index' | "${LOCAL}/help/float.sh") \href{https://ieeexplore.ieee.org/abstract/document/303623/}{Maintainability Index} +FOut $(echo "${body}" | jq '.fanout_external' | "${LOCAL}/help/float.sh") \href{https://en.wikipedia.org/wiki/Fan-out_(software)}{Fan-Out} EOT diff --git a/metrics/pmd.sh b/metrics/pmd.sh index 7f1df7f2..e52547b4 100755 --- a/metrics/pmd.sh +++ b/metrics/pmd.sh @@ -58,10 +58,10 @@ sed 's/xmlns=".*"//g' "${tmp}/result.xml" | \ ruby -e " a = STDIN.read.split(' ').map(&:to_i) sum = a.inject(&:+) - puts \"coco #{a.empty? ? 0 : sum} Summary of ${tail}\" - puts \"acoco #{a.empty? ? 0 : sum / a.count} Average of ${tail}\" - puts \"mxcoco #{a.empty? ? 0 : a.max} Maximum ${tail}\" - puts \"mncoco #{a.empty? ? 0 : a.min} Minimum ${tail}\" + puts \"CoCo #{a.empty? ? 0 : sum} Summary of ${tail}\" + puts \"ACoCo #{a.empty? ? 0 : sum / a.count} Average of ${tail}\" + puts \"MxCoCo #{a.empty? ? 0 : a.max} Maximum ${tail}\" + puts \"MnCoCo #{a.empty? ? 0 : a.min} Minimum ${tail}\" " > "${output}" rm -rf "${tmp}" diff --git a/metrics/raf.sh b/metrics/raf.sh index 3316e55e..fd4f2496 100755 --- a/metrics/raf.sh +++ b/metrics/raf.sh @@ -44,6 +44,6 @@ else raf=0 fi -echo "raf ${raf} Relative Age of File (in the entire timeframe of repository existence), \ +echo "RAF ${raf} Relative Age of File (in the entire timeframe of repository existence), \ where 0.0 means the file was added in the first commit and 1.0 means that \ the file was added in the last commit" > "${output}" diff --git a/tests/metrics/test-ast.sh b/tests/metrics/test-ast.sh index 5ce7014d..f7da6950 100755 --- a/tests/metrics/test-ast.sh +++ b/tests/metrics/test-ast.sh @@ -39,31 +39,31 @@ stdout=$2 }" > "${java}" "${LOCAL}/metrics/ast.py" "${java}" "${temp}/stdout" cat "${temp}/stdout" - grep "nooa 2 " "${temp}/stdout" - grep "nosa 2 " "${temp}/stdout" - grep "noca 1 " "${temp}/stdout" - grep "noom 3 " "${temp}/stdout" - grep "noii 2 " "${temp}/stdout" - grep "napc 1 " "${temp}/stdout" - grep "notp 1 " "${temp}/stdout" - grep "final 1 " "${temp}/stdout" - grep "noca 1 " "${temp}/stdout" - grep "pvn 2.75 " "${temp}/stdout" - grep "mxpvn 6 " "${temp}/stdout" - grep "mnpvn 1 " "${temp}/stdout" - grep "pcn 1" "${temp}/stdout" - grep "mhf 1.0 " "${temp}/stdout" - grep "smhf 0 " "${temp}/stdout" - grep "ahf 0.25 " "${temp}/stdout" - grep "sahf 0.0 " "${temp}/stdout" - grep "nomp 0 " "${temp}/stdout" - grep "nosmp 0 " "${temp}/stdout" - grep "mxnomp 0 " "${temp}/stdout" - grep "mxnosmp 0 " "${temp}/stdout" - grep "nom 0 " "${temp}/stdout" - grep "nop 0 " "${temp}/stdout" - grep "nulls 0 " "${temp}/stdout" - grep "doer 0.5 " "${temp}/stdout" + grep "NoOA 2 " "${temp}/stdout" + grep "NoSA 2 " "${temp}/stdout" + grep "NoCC 0 " "${temp}/stdout" + grep "NoOM 3 " "${temp}/stdout" + grep "NoII 2 " "${temp}/stdout" + grep "NAPC 1 " "${temp}/stdout" + grep "NoTP 1 " "${temp}/stdout" + grep "Final 1 " "${temp}/stdout" + grep "NoCA 1 " "${temp}/stdout" + grep "PVN 2.75 " "${temp}/stdout" + grep "MxPVN 6 " "${temp}/stdout" + grep "MnPVN 1 " "${temp}/stdout" + grep "PCN 1" "${temp}/stdout" + grep "MHF 1.0 " "${temp}/stdout" + grep "SMHF 0 " "${temp}/stdout" + grep "AHF 0.25 " "${temp}/stdout" + grep "SAHF 0.0 " "${temp}/stdout" + grep "NoMP 0 " "${temp}/stdout" + grep "NoSMP 0 " "${temp}/stdout" + grep "MxNOMP 0 " "${temp}/stdout" + grep "MxNOSMP 0 " "${temp}/stdout" + grep "NOM 0 " "${temp}/stdout" + grep "NOP 0 " "${temp}/stdout" + grep "NULLs 0 " "${temp}/stdout" + grep "DOER 0.5 " "${temp}/stdout" } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Correctly collected AST metrics" @@ -75,7 +75,7 @@ echo "πŸ‘πŸ» Correctly collected AST metrics" }" > "${java}" "${LOCAL}/metrics/ast.py" "${java}" "${temp}/stdout" cat "${temp}/stdout" - grep "nulls 1 " "${temp}/stdout" + grep "NULLs 1 " "${temp}/stdout" } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Correctly counted NULL references" diff --git a/tests/metrics/test-authors.sh b/tests/metrics/test-authors.sh index 660a20a5..fd1f390e 100755 --- a/tests/metrics/test-authors.sh +++ b/tests/metrics/test-authors.sh @@ -29,7 +29,7 @@ stdout=$2 { tmp=$(mktemp -d /tmp/XXXX) "${LOCAL}/metrics/authors.sh" "${tmp}" "${temp}/stdout" - grep "noga 0 " "${temp}/stdout" + grep "NoGA 0 " "${temp}/stdout" } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Didn't fail in non-git directory" @@ -45,6 +45,6 @@ echo "πŸ‘πŸ» Didn't fail in non-git directory" git config commit.gpgsign false git commit --quiet -am start "${LOCAL}/metrics/authors.sh" "${java}" stdout - grep "noga 1 " stdout + grep "NoGA 1 " stdout } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Correctly calculated authors" diff --git a/tests/metrics/test-cloc.sh b/tests/metrics/test-cloc.sh index bb1e5d59..4c9861cc 100755 --- a/tests/metrics/test-cloc.sh +++ b/tests/metrics/test-cloc.sh @@ -30,8 +30,8 @@ stdout=$2 java="${temp}/Foo long 'weird' name (--).java" echo "class Foo {}" > "${java}" "${LOCAL}/metrics/cloc.sh" "${java}" "${temp}/stdout" - grep "loc 1 " "${temp}/stdout" - grep "nobl 0 " "${temp}/stdout" - grep "nocl 0 " "${temp}/stdout" + grep "LoC 1 " "${temp}/stdout" + grep "NoBL 0 " "${temp}/stdout" + grep "NoCL 0 " "${temp}/stdout" } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Correctly counted lines of code" diff --git a/tests/metrics/test-cyclomatic_complexity.sh b/tests/metrics/test-cyclomatic_complexity.sh index e292f63c..28d92935 100755 --- a/tests/metrics/test-cyclomatic_complexity.sh +++ b/tests/metrics/test-cyclomatic_complexity.sh @@ -31,7 +31,7 @@ stdout=$2 mkdir -p "$(dirname "${java}")" echo "class Foo {}" > "${java}" "${LOCAL}/metrics/cyclomatic_complexity.py" "${java}" "${temp}/stdout" - grep "cc 1 " "${temp}/stdout" + grep "CC 1 " "${temp}/stdout" } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Correctly calculated cyclomatic complexity" diff --git a/tests/metrics/test-multimetric.sh b/tests/metrics/test-multimetric.sh index 8103be02..f57832b3 100755 --- a/tests/metrics/test-multimetric.sh +++ b/tests/metrics/test-multimetric.sh @@ -49,10 +49,10 @@ EOT "${LOCAL}/metrics/multimetric.sh" "${java}" "${temp}/stdout" cat "${TARGET}/temp/multimetric.json" cat "${temp}/stdout" - grep "hsd 6 " "${temp}/stdout" - grep "hse 1133.21789508 " "${temp}/stdout" - grep "hsv 188.86964918 " "${temp}/stdout" - grep "midx 100 " "${temp}/stdout" - grep "fout 0 " "${temp}/stdout" + grep "HSD 6 " "${temp}/stdout" + grep "HSE 1133.21789508 " "${temp}/stdout" + grep "HSV 188.86964918 " "${temp}/stdout" + grep "MIdx 100 " "${temp}/stdout" + grep "FOut 0 " "${temp}/stdout" } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Correctly counted a few metrics" diff --git a/tests/metrics/test-pmd.sh b/tests/metrics/test-pmd.sh index cfb0af0c..6625b99a 100755 --- a/tests/metrics/test-pmd.sh +++ b/tests/metrics/test-pmd.sh @@ -38,6 +38,6 @@ echo "πŸ‘πŸ» PMD dependencies are installed" mkdir -p "$(dirname "${java}")" echo "class Foo {}" > "${java}" "${LOCAL}/metrics/pmd.sh" "${java}" "${temp}/stdout" - grep "coco 0 " "${temp}/stdout" + grep "CoCo 0 " "${temp}/stdout" } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Correctly calculated congitive complexity" diff --git a/tests/metrics/test-raf.sh b/tests/metrics/test-raf.sh index 8d3ef5b3..49732125 100755 --- a/tests/metrics/test-raf.sh +++ b/tests/metrics/test-raf.sh @@ -32,7 +32,7 @@ stdout=$2 touch "temp_file" mkdir -p "${LOCAL}/${temp}" "${LOCAL}/metrics/raf.sh" "temp_file" "${LOCAL}/${temp}/stdout" - grep "raf 0 " "${LOCAL}/${temp}/stdout" + grep "RAF 0 " "${LOCAL}/${temp}/stdout" } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Didn't fail in non-git directory" @@ -60,8 +60,8 @@ echo "πŸ‘πŸ» Didn't fail in non-git directory" git add "${file3}" git commit --quiet -m "third" "${LOCAL}/metrics/raf.sh" "${file3}" "t3" - grep "raf 1.0 " "t1" # File is created with repo - grep "raf 0.5 " "t2" # File created right now - grep "raf 0.0 " "t3" # File created exactly in the middle + grep "RAF 1.0 " "t1" # File is created with repo + grep "RAF 0.5 " "t2" # File created right now + grep "RAF 0.0 " "t3" # File created exactly in the middle } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Correctly calculated the Relative Age of File" diff --git a/tests/steps/test-allcaps.sh b/tests/steps/test-allcaps.sh new file mode 100755 index 00000000..eef58cad --- /dev/null +++ b/tests/steps/test-allcaps.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +# The MIT License (MIT) +# +# Copyright (c) 2021-2024 Yegor Bugayenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +set -e +set -o pipefail + +temp=$1 +stdout=$2 + +{ + java="${temp}/Foo(xls;)';ΠΎΠ³ΠΎ ΠΏΡ€ΠΈΠ²Π΅Ρ‚ '\".java" + cat > "${java}" < "${stdout}" 2>&1 +echo "πŸ‘πŸ» All metrics are correctly named in AllCaps format" + + + diff --git a/tests/steps/test-measure-file.sh b/tests/steps/test-measure-file.sh index 17de6cd1..13eee727 100755 --- a/tests/steps/test-measure-file.sh +++ b/tests/steps/test-measure-file.sh @@ -55,26 +55,26 @@ EOT metric=${m//m\./} echo "${metric}: $(cat "${temp}/${m}")" done - test "$(cat "${temp}/m1.loc")" = "8" - test "$(cat "${temp}/m1.nocl")" = "1" - test "$(cat "${temp}/m1.cc")" = "1" - test "$(cat "${temp}/m1.ncss")" = "7" - test "$(cat "${temp}/m1.nocm")" = "0" - test "$(cat "${temp}/m1.noom")" = "1" - test "$(cat "${temp}/m1.nocc")" = "1" - test "$(cat "${temp}/m1.napc")" = "1" - test "$(cat "${temp}/m1.noii")" = "1" - test "$(cat "${temp}/m1.notp")" = "0" - test "$(cat "${temp}/m1.final")" = "0" - test "$(cat "${temp}/m1.nobl")" = "1" - test "$(cat "${temp}/m1.hsd")" = "6.1875" - test "$(cat "${temp}/m1.hsv")" = "122.62388524" - test "$(cat "${temp}/m1.hse")" = "758.73528991" - test "$(cat "${temp}/m1.coco")" = "0" - test "$(cat "${temp}/m1.fout")" = "0" + test "$(cat "${temp}/m1.LoC")" = "8" + test "$(cat "${temp}/m1.NoCL")" = "1" + test "$(cat "${temp}/m1.CC")" = "1" + test "$(cat "${temp}/m1.NCSS")" = "7" + test "$(cat "${temp}/m1.NoCM")" = "0" + test "$(cat "${temp}/m1.NoOM")" = "1" + test "$(cat "${temp}/m1.NoCC")" = "1" + test "$(cat "${temp}/m1.NAPC")" = "1" + test "$(cat "${temp}/m1.NoII")" = "1" + test "$(cat "${temp}/m1.NoTP")" = "0" + test "$(cat "${temp}/m1.Final")" = "0" + test "$(cat "${temp}/m1.NoBL")" = "1" + test "$(cat "${temp}/m1.HSD")" = "6.1875" + test "$(cat "${temp}/m1.HSV")" = "122.62388524" + test "$(cat "${temp}/m1.HSE")" = "758.73528991" + test "$(cat "${temp}/m1.CoCo")" = "0" + test "$(cat "${temp}/m1.FOut")" = "0" test "$(cat "${temp}/m1.LCOM5")" = "0" - test "$(cat "${temp}/m1.raf")" = "0" - test "$(cat "${temp}/m1.nulls")" = "0" + test "$(cat "${temp}/m1.RAF")" = "0" + test "$(cat "${temp}/m1.NULLs")" = "0" set +x } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Single file measured correctly" @@ -86,9 +86,9 @@ echo "πŸ‘πŸ» Single file measured correctly" echo "${msg}" echo "${msg}" | grep "Failed to collect ast.py" echo "${msg}" | grep "Failed to collect cyclomatic_complexity.py" - test -e "${temp}/m2.coco" - test -e "${temp}/m2.loc" - test ! -e "${temp}/m2.cc" + test -e "${temp}/m2.CoCo" + test -e "${temp}/m2.LoC" + test ! -e "${temp}/m2.CC" } > "${stdout}" 2>&1 echo "πŸ‘πŸ» Broken syntax measured and error log created" diff --git a/tests/test-integration.sh b/tests/test-integration.sh index e4ba1b10..8b17cf34 100755 --- a/tests/test-integration.sh +++ b/tests/test-integration.sh @@ -47,10 +47,10 @@ stdout=$2 test -f "${TARGET}/${f}" done test "$(find "${TARGET}" -maxdepth 1 | wc -l | xargs)" = 10 - test -f "${TARGET}/data/${repo}/ncss.csv" + test -f "${TARGET}/data/${repo}/NCSS.csv" test -f "${TARGET}/data/${repo}/NHD.csv" test -f "${TARGET}/data/${repo}/SCOM-cvc.csv" - test -f "${TARGET}/data/ncss.csv" + test -f "${TARGET}/data/NCSS.csv" test -f "${TARGET}/data/NHD.csv" test -f "${TARGET}/data/SCOM-cvc.csv" test -d "${TARGET}/measurements/${repo}/src/main/java" @@ -59,10 +59,6 @@ stdout=$2 test -f "${TARGET}/temp/reports/010-delete-non-java-files.sh.tex" test -f "${TARGET}/temp/pdf-report/report.tex" test -f "${TARGET}"/*.zip - test -f "${TARGET}/hashes.csv" - test -f "${TARGET}/repositories.csv" - test -f "${TARGET}/start.txt" - test -f "${TARGET}/report.pdf" if grep "NaN" "${TARGET}/data/${repo}/NHD.csv"; then echo "NaN found in jpeek report" exit 1