biagios/venter

View on GitHub

Showing 34 of 54 total issues

Function run has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

exports.run = async (client, message, [action, key, ...value], level) => {
// eslint-disable-line no-unused-vars
// Retrieve current guild settings (merged) and overrides only.
const serverSettings = message.settings;
const defaults = settings.get("default");
Severity: Minor
Found in commands/set.js - About 4 hrs to fix

Function run has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

exports.run = async (client, message, [action, key, ...value], level) => { // eslint-disable-line no-unused-vars
 
// Retrieve Default Values from the default settings in the bot.
const defaults = settings.get("default");
const replying = settings.ensure(message.guild.id, config.defaultSettings).commandReply;
Severity: Minor
Found in commands/conf.js - About 4 hrs to fix

Function run has 99 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.run = async (client, message, [action, key, ...value], level) => {
// eslint-disable-line no-unused-vars
// Retrieve current guild settings (merged) and overrides only.
const serverSettings = message.settings;
const defaults = settings.get("default");
Severity: Major
Found in commands/set.js - About 3 hrs to fix

    Function log has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.log = (content, type = "log") => {
    const logsRevealer = new WebhookClient({
    id: config.logshook[0],
    token: config.logshook[1],
    });
    Severity: Major
    Found in modules/logger.js - About 2 hrs to fix

      Function run has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      exports.run = (client, message, args, level) => {
      // Grab the container from the client to reduce line length.
      const { container } = client;
      // If no specific command is called, show all filtered commands.
      if (!args[0]) {
      Severity: Minor
      Found in commands/help.js - About 2 hrs to fix

      Function exports has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = async (client, message) => {
      // Grab the container from the client to reduce line length.
      const { container } = client;
      // It's good practice to ignore other bots. This also makes your bot ignore
      // itself and not get into a spam loop (we call that "botception").
      Severity: Major
      Found in events/messageCreate.js - About 2 hrs to fix

        Function run has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.run = (client, message, args, level) => {
        // Grab the container from the client to reduce line length.
        const { container } = client;
        // If no specific command is called, show all filtered commands.
        if (!args[0]) {
        Severity: Major
        Found in commands/help.js - About 2 hrs to fix

          Function exports has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = async (client, message) => {
          // Grab the container from the client to reduce line length.
          const { container } = client;
          // It's good practice to ignore other bots. This also makes your bot ignore
          // itself and not get into a spam loop (we call that "botception").
          Severity: Minor
          Found in events/messageCreate.js - About 2 hrs to fix

          Function exports has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = async (client, interaction) => {
          // If it's not a command, stop.
          if (!interaction.isCommand()) return;
           
          if (bans.users.includes(interaction.user.id)) {
          Severity: Major
          Found in events/interactionCreate.js - About 2 hrs to fix

            Function run has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            exports.run = async (client, interaction) => {
            // eslint-disable-line no-unused-vars
            const duration = durationFormatter.format(client.uptime);
            const stats = codeBlock(
            "asciidoc",
            Severity: Major
            Found in slash/stats.js - About 2 hrs to fix

              Function run has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              exports.run = async (client, message, [action, key, ...value], level) => { // eslint-disable-line no-unused-vars
               
              // Retrieve Default Values from the default settings in the bot.
              const defaults = settings.get("default");
              const replying = settings.ensure(message.guild.id, config.defaultSettings).commandReply;
              Severity: Minor
              Found in commands/conf.js - About 1 hr to fix

                Function init has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const init = async () => {
                // Here we load **commands** into memory, as a collection, so they're
                // accessible here and everywhere else.
                const commands = readdirSync("./commands/").filter((file) =>
                file.endsWith(".js"),
                Severity: Minor
                Found in index.js - About 1 hr to fix

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

                  exports.run = async (client, message, args, level) => {
                  // eslint-disable-line no-unused-vars
                  const replying = settings.ensure(
                  message.guild.id,
                  config.defaultSettings,
                  Severity: Minor
                  Found in commands/reboot.js - About 1 hr to fix

                    Function exports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = async (client, interaction) => {
                    // If it's not a command, stop.
                    if (!interaction.isCommand()) return;
                     
                    if (bans.users.includes(interaction.user.id)) {
                    Severity: Minor
                    Found in events/interactionCreate.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                    if (!defaults[key]) return message.reply({ content: "This key does not exist in the settings", allowedMentions: { repliedUser: (replying === "true") }});
                    Severity: Major
                    Found in commands/conf.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                      if (["n","no","cancel"].includes(response)) {
                      message.reply({ content: "Action cancelled.", allowedMentions: { repliedUser: (replying === "true") }});
                      }
                      Severity: Major
                      Found in commands/conf.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                        for (const [guildId, conf] of settings.filter((setting, id) => setting[key] && id !== "default")) {
                        delete conf[key];
                        settings.set(guildId, conf);
                        }
                        Severity: Major
                        Found in commands/conf.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                          if (!key) return message.reply({ content: "Please specify a key to view", allowedMentions: { repliedUser: (replying === "true") }});
                          Severity: Major
                          Found in commands/conf.js - About 45 mins to fix

                            Avoid too many return statements within this function.
                            Open

                            if (!key) return message.reply({ content: "Please specify a key to view", allowedMentions: { repliedUser: (replying === "true") }});
                            Severity: Major
                            Found in commands/conf.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                              if (value.length < 1) return message.reply({ content: "Please specify a new value", allowedMentions: { repliedUser: (replying === "true") }});
                              Severity: Major
                              Found in commands/conf.js - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language