diff --git a/indicators/cyclomatic_complexity.json b/indicators/cyclomatic_complexity.json new file mode 100644 index 0000000..64e1c16 --- /dev/null +++ b/indicators/cyclomatic_complexity.json @@ -0,0 +1,41 @@ +{ + "@context": "https://w3id.org/everse/rsqi#", + "@id": "https://w3id.org/everse/i/indicators/cyclomatic_complexity_ok", + "@type": "SoftwareQualityIndicator", + "name": "Cyclomatic complexity follows community conventions", + "abbreviation": "cyclomatic_complexity_ok", + "identifier": { "@id": "https://w3id.org/everse/i/indicators/cyclomatic_complexity_ok" }, + "description": "Cyclomatic complexity (i.e., the number of linearly independent paths through a program’s source code) of the whole software component or modules/components/classes/functions/methods should follow the conventions established by the community responsible for maintaining the tool. Cyclomatic complexity is created by calculating the number of different code paths in the flow of the program. A program that has complex control flow requires more tests to achieve good code coverage and is less maintainable.", + "status": "Active", + "keywords": [ + "maintainability", "complexity, code" + ], + "version": "1.0.0", + "author": { + "@type": "schema:Person", + "name": "Daniel Garijo" + }, + "contact": [ + { + "@type": "schema:Person", + "name": "Daniel Garijo" + }, + { + "@type": "schema:Person", + "name": "Andres Montero" + } + ], + "source": [ + { + "identifier": "https://zenodo.org/records/10647227", + "url": "https://zenodo.org/records/10647227", + "name": "Task Force Sub Group 3 - Review of Software Quality Attributes and Characteristics" + }, + { + "url": "https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=11216562&tag=1", + "name": "Socially-Informed Jupyter Notebook Quality: A Role- and Lifecycle-Aware Metrics Framework" + } + ], + "qualityDimension": { "@id": "https://w3id.org/everse/i/dimensions/maintainability" }, + "created": "10-03-2026" +} diff --git a/website/rs_tiers.html b/website/rs_tiers.html index 1fefb7f..112cea6 100644 --- a/website/rs_tiers.html +++ b/website/rs_tiers.html @@ -225,10 +225,8 @@

Relevance of Indicators for RS Tiers

let originalData = []; const tierOrder = ["crucial", "recommended", "good to have", "not relevant"]; - let currentSort = { - column: null, - index: -1 - }; + let activeSortColumn = null; + async function fetchCSVFile(csvPath) { const overlay = document.getElementById("table-loading-overlay"); @@ -322,39 +320,22 @@

Relevance of Indicators for RS Tiers

} function sortByTier(column) { - if (currentSort.column !== column) { - currentSort.column = column; - currentSort.index = -1; - } - - const presentValues = tierOrder.filter(value => - allData.some(item => - (item[column] || "").toLowerCase() === value - ) - ); - - if (presentValues.length === 0) { - return; - } - - currentSort.index++; - - if (currentSort.index >= presentValues.length) { - currentSort.column = null; - currentSort.index = -1; + if (activeSortColumn === column) { + activeSortColumn = null; updateTableFromCSV(originalData); return; } - const priority = presentValues[currentSort.index]; + activeSortColumn = column; - const sorted = [...allData].sort((a, b) => { - const aVal = (a[column] || "").toLowerCase(); - const bVal = (b[column] || "").toLowerCase(); + const orderIndex = value => { + const normalized = (value || "").toLowerCase(); + const idx = tierOrder.indexOf(normalized); + return idx === -1 ? tierOrder.length : idx; + }; - if (aVal === priority && bVal !== priority) return -1; - if (bVal === priority && aVal !== priority) return 1; - return 0; + const sorted = [...allData].sort((a, b) => { + return orderIndex(a[column]) - orderIndex(b[column]); }); updateTableFromCSV(sorted);