packages/compile-vyper/index.js
File index.js
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const debug = require("debug")("compile-vyper");
const path = require("path");
const exec = require("child_process").exec;
const fs = require("fs");
const colors = require("colors");
Function sourcesWithDependencies
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async sourcesWithDependencies({ paths = [], options }) {
options = Config.default().merge(options);
debug("paths: %O", paths);
const vyperFilesStrict = paths.filter(path =>
minimatch(path, VYPER_PATTERN_STRICT, { dot: true })
Function execVyper
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function execVyper(options, sourcePath, version, callback) {
const formats = ["abi", "bytecode", "bytecode_runtime"];
debug("version: %s", version);
if (
semver.satisfies(version, ">=0.1.0-beta.7", {
Function checkVyper
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function checkVyper() {
return new Promise((resolve, reject) => {
exec("vyper-json --version", function (err, stdout, _stderr) {
if (err) {
//vyper-json not available, check vyper
Function execVyper
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function execVyper(options, sourcePath, version, callback) {
const formats = ["abi", "bytecode", "bytecode_runtime"];
debug("version: %s", version);
if (
semver.satisfies(version, ">=0.1.0-beta.7", {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function display
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
async display(paths, options) {
if (options.quiet !== true) {
if (!Array.isArray(paths)) {
paths = Object.keys(paths);
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"