nielsmaerten/peppermint

View on GitHub

Showing 6 of 15 total issues

File main.js has 408 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
    Ethereal by HTML5 UP
    html5up.net | @ajlkn
    Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
*/
Severity: Minor
Found in public/assets/js/main.js - About 5 hrs to fix

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

          var normalizeWheel = function (event) {
    
            var pixelStep = 10,
              lineHeight = 40,
              pageHeight = 800,
    Severity: Minor
    Found in public/assets/js/main.js - About 1 hr to fix

      Function getInterestedUsers has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public async getInterestedUsers(redditpost: RedditPost): Promise<User[]> {
          let users: User[] = []
          let presortedUsers = (await admin
            .database()
            .ref(Config.userListRef)
      Severity: Minor
      Found in src/clients/firebase-client.ts - About 1 hr to fix

        Function uploadImage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public uploadImage(image: RedditPost) {
            return new Promise((resolve, reject) => {
              const chunks: Buffer[] = []
              this.getHttpOrHttps(
                image.imageUrl
        Severity: Minor
        Found in src/clients/dropbox-client.ts - About 1 hr to fix

          Function dropHandler has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          function dropHandler(ev) {
            console.log('File(s) dropped');
          
            // Prevent default behavior (Prevent file from being opened)
            ev.preventDefault();
          Severity: Minor
          Found in public/src/lookup.js - About 55 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 getInterestedUsers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            public async getInterestedUsers(redditpost: RedditPost): Promise<User[]> {
              let users: User[] = []
              let presortedUsers = (await admin
                .database()
                .ref(Config.userListRef)
          Severity: Minor
          Found in src/clients/firebase-client.ts - 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