Skip to content

Commit

Permalink
GH Action Standards
Browse files Browse the repository at this point in the history
  • Loading branch information
confused-Techie authored and github-actions[bot] committed Feb 19, 2024
1 parent 34899ff commit a31d72b
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 233 deletions.
60 changes: 40 additions & 20 deletions docs/resources/complexity-report.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Complexity report, 2/10/2024

* Mean per-function logical LOC: 15.14179104477612
* Mean per-function parameter count: 0.1574626865671642
* Mean per-function cyclomatic complexity: 1.2522388059701492
* Mean per-function Halstead effort: 3219.3977934951786
* Mean per-module maintainability index: 67.82180870506276
* First-order density: 0.7128536422365783%
* Change cost: 4.5444419692581866%
# Complexity report, 2/19/2024

* Mean per-function logical LOC: 15.036764705882353
* Mean per-function parameter count: 0.1698529411764706
* Mean per-function cyclomatic complexity: 1.2632352941176472
* Mean per-function Halstead effort: 3195.428995748861
* Mean per-module maintainability index: 67.8207342918712
* First-order density: 0.7136678200692042%
* Change cost: 4.541522491349481%
* Core size: 100%

## /home/runner/work/package-backend/package-backend/jest.config.js
Expand Down Expand Up @@ -51,13 +51,13 @@

## /home/runner/work/package-backend/package-backend/src/context.js

* Physical LOC: 21
* Logical LOC: 19
* Physical LOC: 22
* Logical LOC: 20
* Mean parameter count: 0
* Cyclomatic complexity: 1
* Cyclomatic complexity density: 5.263157894736842%
* Maintainability index: 56.91380338014516
* Dependency count: 17
* Cyclomatic complexity density: 5%
* Maintainability index: 56.30447000270189
* Dependency count: 18

## /home/runner/work/package-backend/package-backend/docs/resources/jsdoc_typedef.js

Expand Down Expand Up @@ -219,6 +219,26 @@
* Halstead volume: 91.37651812938249
* Halstead effort: 186.9065143555551

## /home/runner/work/package-backend/package-backend/src/bundled_packages/index.js

* Physical LOC: 84
* Logical LOC: 40
* Mean parameter count: 1
* Cyclomatic complexity: 2
* Cyclomatic complexity density: 5%
* Maintainability index: 68.47368457802489
* Dependency count: 1
* Function: **buildPackage**
* Line No.: 75
* Physical LOC: 14
* Logical LOC: 6
* Parameter count: 1
* Cyclomatic complexity: 2
* Cyclomatic complexity density: 33.33333333333333%
* Halstead difficulty: 6.75
* Halstead volume: 204.3263250706733
* Halstead effort: 1379.2026942270447

## /home/runner/work/package-backend/package-backend/src/controllers/endpoints.js

* Physical LOC: 30
Expand Down Expand Up @@ -551,12 +571,12 @@

## /home/runner/work/package-backend/package-backend/tests/models/packageObjectFull.js

* Physical LOC: 147
* Logical LOC: 86
* Physical LOC: 150
* Logical LOC: 87
* Mean parameter count: 0
* Cyclomatic complexity: 1
* Cyclomatic complexity density: 1.1627906976744187%
* Maintainability index: 37.52288274528104
* Cyclomatic complexity density: 1.1494252873563218%
* Maintainability index: 37.40385881694914
* Dependency count: 0

## /home/runner/work/package-backend/package-backend/tests/models/packageObjectFullArray.js
Expand All @@ -581,12 +601,12 @@

## /home/runner/work/package-backend/package-backend/tests/models/packageObjectShort.js

* Physical LOC: 137
* Physical LOC: 139
* Logical LOC: 88
* Mean parameter count: 0
* Cyclomatic complexity: 1
* Cyclomatic complexity density: 1.1363636363636365%
* Maintainability index: 37.62685787133425
* Maintainability index: 37.630279207121085
* Dependency count: 0

## /home/runner/work/package-backend/package-backend/tests/models/packageObjectShortArray.js
Expand Down
42 changes: 23 additions & 19 deletions scripts/tools/update-bundled.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@ const REPOS = [
{
name: "pulsar",
url: "https://github.com/pulsar-edit/pulsar",
isPulsar: true
isPulsar: true,
},
{
name: "snippets",
url: "https://github.com/pulsar-edit/snippets",
isPulsar: false
isPulsar: false,
},
{
name: "github",
url: "https://github.com/pulsar-edit/github",
isPulsar: false
}
isPulsar: false,
},
];

(async () => {

// First lets clone the repos

for (let i = 0; i < REPOS.length; i++) {
Expand All @@ -40,45 +39,48 @@ const REPOS = [
await cloneRepo(REPO.url, path.join("bundled-repos", REPO.name));

scanPulsarPackages();

} else {
// Any other single package repo

await cloneRepo(REPO.url, path.join("bundled-repos", REPO.name));

findDetails(path.resolve(process.cwd(), path.join("bundled-repos", REPO.name)));
findDetails(
path.resolve(process.cwd(), path.join("bundled-repos", REPO.name))
);
}
}

// Now lets save the file
fs.writeFileSync(
path.resolve(process.cwd(), path.join("src", "bundled_packages", "bundled.json")),
path.resolve(
process.cwd(),
path.join("src", "bundled_packages", "bundled.json")
),
JSON.stringify(BUNDLED, null, 2),
{ encoding: "utf8" }
);
console.log("Saved new Bundled Info");

})();


async function cloneRepo(repoName, filePath) {

try {
console.log(`Handling '${repoName}'...`);

const { stdout, stderr } = await exec(`git clone ${repoName} ${filePath}`);

console.log("stdout: ", stdout);
console.log("stderr: ", stderr);

} catch(err) {
} catch (err) {
console.error(err);
}
return;
}

function scanPulsarPackages() {
const packsPath = path.resolve(process.cwd(), path.join("bundled-repos", "pulsar", "packages"));
const packsPath = path.resolve(
process.cwd(),
path.join("bundled-repos", "pulsar", "packages")
);
const dirs = fs.readdirSync(packsPath);

for (const dir of dirs) {
Expand All @@ -91,19 +93,21 @@ function scanPulsarPackages() {

findDetails(packPath);
}

}

function findDetails(packPath) {
// Reads the data from disk, adding it to the top level bundled package object
const readme = fs.readFileSync(path.join(packPath, "README.md"), { encoding: "utf8" });
const packJson = JSON.parse(fs.readFileSync(path.join(packPath, "package.json"), { encoding: "utf8" }));
const readme = fs.readFileSync(path.join(packPath, "README.md"), {
encoding: "utf8",
});
const packJson = JSON.parse(
fs.readFileSync(path.join(packPath, "package.json"), { encoding: "utf8" })
);

BUNDLED[packJson.name] = {
readme: readme,
metadata: packJson
metadata: packJson,
// While technically this could make the file larger, it's worth making sure we
// get all current and future important details
};

}
Loading

0 comments on commit a31d72b

Please sign in to comment.