trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

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

export function* saga(moduleOptions) {
  debug("starting listeners");
  yield* forkListeners(moduleOptions);

  // receiving & saving contracts into state
Severity: Minor
Found in packages/debugger/lib/session/sagas/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 make1193ProviderRequest has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function make1193ProviderRequest(provider) {
        /*
        NOTE: If truffle switches to use WebSockets instead of HTTP requests in the future
              then we will need to keep separate requestId counters for .request and .send
              methods to avoid collision while generating requestIds on parallel requests.
      Severity: Minor
      Found in packages/provider/wrapper.js - About 1 hr to fix

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

          async deployNewDevReverseRegistrar(from) {
            const registryAddress = this.determineENSRegistryAddress();
            debug("from: %s", from);
            debug("registryAddress: %s", registryAddress);
            const ReverseRegistrarArtifact = require("./builtContracts/ReverseRegistrar");
        Severity: Minor
        Found in packages/deployer/ens.js - About 1 hr to fix

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

            public async eventsWithAdditionalContexts(
              options: DecoderTypes.EventOptions = {},
              additionalContexts: Contexts.Contexts = {}
            ): Promise<DecoderTypes.DecodedLog[]> {
              let { address, name, fromBlock, toBlock } = options;
          Severity: Minor
          Found in packages/decoder/lib/decoders.ts - About 1 hr to fix

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

              safelyEvaluateWithSelectors(expression, context) {
                const select = this.select;
                let interpreter;
                interpreter = new Interpreter(expression, function (
                  interpreter,
            Severity: Minor
            Found in packages/core/lib/debug/printer.js - About 1 hr to fix

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

              function App(): JSX.Element {
                return (
                  <>
                    <ul className={styles["links"]}>
                      {links.map((C, i) => (
              Severity: Minor
              Found in packages/codec-components/src/docs/index.tsx - About 1 hr to fix

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

                  private async processRequest(
                    publisher: WebSocket,
                    data: WebSocket.Data,
                    subscribers: WebSocket[]
                  ) {
                Severity: Minor
                Found in packages/dashboard-message-bus/lib/DashboardMessageBus.ts - About 1 hr to fix

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

                    const connect = (connectOptions?: ConnectOptions<C>): Db<C> => {
                      const attachOptions = {
                        adapter: (connectOptions || {}).adapter
                      };
                      const workspace = attach(attachOptions);
                  Severity: Minor
                  Found in packages/db/src/meta/interface.ts - About 1 hr to fix

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

                      lastCompletedMigration: async function (options: Config): Promise<number> {
                        let Migrations: any; // I don't think we have a good type for this yet
                    
                        try {
                          Migrations = options.resolver.require("Migrations");
                    Severity: Minor
                    Found in packages/migrate/src/index.ts - About 1 hr to fix

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

                        extract({ input, inputs, breadcrumb }) {
                          const { artifacts } = inputs;
                          const { artifactIndex } = breadcrumb;
                      
                          const artifact = artifacts[artifactIndex];
                      Severity: Minor
                      Found in packages/db/src/project/loadMigrate/contractInstances.ts - About 1 hr to fix

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

                          *process({
                            entries,
                            inputs: {
                              project: { id }
                            }
                        Severity: Minor
                        Found in packages/db/src/project/assignNames/getCurrent.ts - About 1 hr to fix

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

                          const useStyles = createStyles((theme, _params, _getRef) => {
                            const { colors, colorScheme, radius, fn } = theme;
                            return {
                              button: {
                                display: "block",

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

                            export function* decodeBytes(
                              dataType: Format.Types.BytesTypeDynamic | Format.Types.StringType,
                              pointer: Pointer.DataPointer,
                              info: Evm.EvmInfo,
                              options: DecoderOptions = {}
                            Severity: Minor
                            Found in packages/codec/lib/bytes/decode/index.ts - About 1 hr to fix

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

                                  const initBusClient = async () => {
                                    await busClient.ready();
                                    console.debug(`Connected to message bus at ws://${host}:${port}`);
                              
                                    // Message bus client subscribes to and handles messages
                              Severity: Minor
                              Found in packages/dashboard/src/contexts/DashContext/DashProvider.tsx - About 1 hr to fix

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                module.exports = function () {
                                  const emoji = String.fromCodePoint(0x1f61e);
                                  console.log(
                                    "\n  " +
                                      emoji +
                                Severity: Major
                                Found in packages/core/lib/commands/install/run.js and 1 other location - About 1 hr to fix
                                packages/core/lib/commands/publish/run.js on lines 1..10

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 58.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                export function* begin({
                                  address,
                                  binary,
                                  data,
                                  storageAddress,
                                Severity: Major
                                Found in packages/debugger/lib/evm/sagas/index.js and 1 other location - About 1 hr to fix
                                packages/debugger/lib/web3/actions/index.js on lines 115..142

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 58.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                export function receiveCall({
                                  address,
                                  binary,
                                  data,
                                  storageAddress,
                                Severity: Major
                                Found in packages/debugger/lib/web3/actions/index.js and 1 other location - About 1 hr to fix
                                packages/debugger/lib/evm/sagas/index.js on lines 168..189

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 58.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                module.exports = function () {
                                  const emoji = String.fromCodePoint(0x1f61e);
                                  console.log(
                                    "\n  " +
                                      emoji +
                                Severity: Major
                                Found in packages/core/lib/commands/publish/run.js and 1 other location - About 1 hr to fix
                                packages/core/lib/commands/install/run.js on lines 1..10

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 58.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                        `${prefix}"${data.contract.contractName}" ran out of gas. Something in the constructor ` +
                                        `(ex: infinite loop) caused gas estimation to fail. Try:\n` +
                                        `   * Making your contract constructor more efficient\n` +
                                        `   * Setting the gas manually in your config or as a deployment parameter\n` +
                                        `   * Using the solc optimizer settings in 'truffle-config.js'\n` +
                                Severity: Major
                                Found in packages/events/defaultSubscribers/migrate/Messages.js and 1 other location - About 1 hr to fix
                                packages/events/defaultSubscribers/migrate/Messages.js on lines 51..55

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 58.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Severity
                                Category
                                Status
                                Source
                                Language