trufflesuite/truffle

View on GitHub
packages/compile-vyper/index.js

Summary

Maintainability
C
1 day
Test Coverage

File index.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
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");
Severity: Minor
Found in packages/compile-vyper/index.js - About 2 hrs to fix

    Function sourcesWithDependencies has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    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 })
    Severity: Minor
    Found in packages/compile-vyper/index.js - About 1 hr to fix

      Function execVyper has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      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", {
      Severity: Minor
      Found in packages/compile-vyper/index.js - About 1 hr to fix

        Function checkVyper has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function checkVyper() {
          return new Promise((resolve, reject) => {
            exec("vyper-json --version", function (err, stdout, _stderr) {
              if (err) {
                //vyper-json not available, check vyper
        Severity: Minor
        Found in packages/compile-vyper/index.js - About 1 hr to fix

          Function execVyper has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          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", {
          Severity: Minor
          Found in packages/compile-vyper/index.js - About 25 mins to fix

          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

            async display(paths, options) {
              if (options.quiet !== true) {
                if (!Array.isArray(paths)) {
                  paths = Object.keys(paths);
                }
          Severity: Minor
          Found in packages/compile-vyper/index.js - About 25 mins to fix

          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

          There are no issues that match your filters.

          Category
          Status