silentrob/superscript

View on GitHub

Showing 67 of 92 total issues

Avoid too many return statements within this function.
Open

      return processContinueSearching(tag, replyObj, options);
Severity: Major
Found in src/bot/processTags.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return 'unknown';
    Severity: Major
    Found in src/plugins/time.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return processClearConversation(tag, replyObj, options);
      Severity: Major
      Found in src/bot/processTags.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return processEndSearching(tag, replyObj, options);
        Severity: Major
        Found in src/bot/processTags.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return processDelay(tag, replyObj, options);
          Severity: Major
          Found in src/bot/processTags.js - About 30 mins to fix

            Function getSeason has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            const getSeason = function getSeason() {
              const now = moment();
              now.dayOfYear();
              const doy = now.dayOfYear();
            
            
            Severity: Minor
            Found in src/plugins/time.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 createTopicModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            const createTopicModel = function createTopicModel(db) {
              const topicSchema = new mongoose.Schema({
                name: { type: String, index: true, unique: true },
            
                system: { type: Boolean, default: false },
            Severity: Minor
            Found in src/bot/db/models/topic.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

            Severity
            Category
            Status
            Source
            Language