rasenderhase/iljig

View on GitHub

Showing 29 of 29 total issues

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

module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON("package.json"),
Severity: Major
Found in Gruntfile.js - About 2 hrs to fix

    Function save has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.save = function(req, res, next){
        var id = req.param("spiel_id", null),
            adminGeheimnis = req.param("adminGeheimnis", null),
            spiel = req.atts.spiel,
            status = spiel ? spiel.status : null,
    Severity: Minor
    Found in modules/resources/spiel.js - About 1 hr to fix

      Function value has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

              value : function(/* Spieler */ spieler) {
                  return new Promise(function (/* function */ resolve, /* function */ reject) {
                      var karten, karte, i = 0,
                          result = null;
                      try {
      Severity: Minor
      Found in modules/iljig/DBService.js - About 1 hr 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 value has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              value : function() {
                  return new Promise(function (/* function */ resolve, /* function */ reject) {
                      var i, list = [],
                          spiel,
                          spielerPromises = [],
      Severity: Minor
      Found in modules/iljig/DBService.js - About 1 hr to fix

        Function save has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.save = function(req, res, next){
            var id = req.param("spieler_id", null),
                adminGeheimnis = req.param("adminGeheimnis", null),
                teilnahmeGeheimnis = req.param("teilnahmeGeheimnis", null),
                spielerName = req.param("spielerName", null),
        Severity: Minor
        Found in modules/resources/spieler.js - About 1 hr to fix

          Function view has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.view = function(req, res, next){
              var spiel = req.atts.spiel,
                  teilnahmeGeheimnis = req.param("teilnahmeGeheimnis", null),
                  adminGeheimnis = req.param("adminGeheimnis", null) || req.cookies.adminGeheimnis,
                  renderOptions = {}, baseUrl;
          Severity: Minor
          Found in modules/resources/spiel.js - About 1 hr to fix

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

            exports.save = function(req, res, next){
                var id = req.param("spieler_id", null),
                    adminGeheimnis = req.param("adminGeheimnis", null),
                    teilnahmeGeheimnis = req.param("teilnahmeGeheimnis", null),
                    spielerName = req.param("spielerName", null),
            Severity: Minor
            Found in modules/resources/spieler.js - About 45 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

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

                        (function () {
                            spielIljig.addSpieler(new k.Spieler(1010, "ands", 1));
                        }).should.throw({ name : "SpielLaeuftSchon" });
            Severity: Minor
            Found in test/modules/iljig/SpielIljig_test.js and 1 other location - About 35 mins to fix
            test/modules/iljig/SpielIljig_test.js on lines 37..39

            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 47.

            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

                        (function () {
                            spielIljig.addSpieler(new k.Spieler(1010, "ands", 1))
                        }).should.throw({ name : "ZuVieleSpieler" });
            Severity: Minor
            Found in test/modules/iljig/SpielIljig_test.js and 1 other location - About 35 mins to fix
            test/modules/iljig/SpielIljig_test.js on lines 44..46

            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 47.

            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

            Function value has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                    value : function(/* String */ spielId) {
                        return new Promise(function (/* function */ resolve, /* function */ reject) {
                            var spielerList = [],
                                spieler,
                                spielIndex,
            Severity: Minor
            Found in modules/iljig/DBService.js - About 35 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 value has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                    value : function() {
                        return new Promise(function (/* function */ resolve, /* function */ reject) {
                            var i, list = [],
                                spiel,
                                spielerPromises = [],
            Severity: Minor
            Found in modules/iljig/DBService.js - About 35 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 value has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                    value : function(/* Date */ maxAlterMs) {
                        function deleteSpieleByMinDate(minDate) {
                            var i = null;
                            for (i in this.db.spiel) {
                                if (!this.db.spiel.hasOwnProperty(i)
            Severity: Minor
            Found in modules/iljig/DBService.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

            Use path.join() or path.resolve() instead of + to create paths.
            Open

                spiel = require(__dirname + "/modules/resources/spiel.js"),
            Severity: Minor
            Found in server.js by eslint

            Disallow string concatenation when using __dirname and __filename (no-path-concat)

            In Node.js, the __dirname and __filename global variables contain the directory path and the file path of the currently executing script file, respectively. Sometimes, developers try to use these variables to create paths to other files, such as:

            var fullPath = __dirname + "/foo.js";

            However, there are a few problems with this. First, you can't be sure what type of system the script is running on. Node.js can be run on any computer, including Windows, which uses a different path separator. It's very easy, therefore, to create an invalid path using string concatenation and assuming Unix-style separators. There's also the possibility of having double separators, or otherwise ending up with an invalid path.

            In order to avoid any confusion as to how to create the correct path, Node.js provides the path module. This module uses system-specific information to always return the correct value. So you can rewrite the previous example as:

            var fullPath = path.join(__dirname, "foo.js");

            This example doesn't need to include separators as path.join() will do it in the most appropriate manner. Alternately, you can use path.resolve() to retrieve the fully-qualified path:

            var fullPath = path.resolve(__dirname, "foo.js");

            Both path.join() and path.resolve() are suitable replacements for string concatenation wherever file or directory paths are being created.

            Rule Details

            This rule aims to prevent string concatenation of directory paths in Node.js

            Examples of incorrect code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = __dirname + "/foo.js";
            
            var fullPath = __filename + "/foo.js";

            Examples of correct code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = dirname + "/foo.js";

            When Not To Use It

            If you want to allow string concatenation of path names. Source: http://eslint.org/docs/rules/

            Use path.join() or path.resolve() instead of + to create paths.
            Open

            app.use("apple-touch-icon.png", express.static(__dirname + "/public/images/icon_100.png"));
            Severity: Minor
            Found in server.js by eslint

            Disallow string concatenation when using __dirname and __filename (no-path-concat)

            In Node.js, the __dirname and __filename global variables contain the directory path and the file path of the currently executing script file, respectively. Sometimes, developers try to use these variables to create paths to other files, such as:

            var fullPath = __dirname + "/foo.js";

            However, there are a few problems with this. First, you can't be sure what type of system the script is running on. Node.js can be run on any computer, including Windows, which uses a different path separator. It's very easy, therefore, to create an invalid path using string concatenation and assuming Unix-style separators. There's also the possibility of having double separators, or otherwise ending up with an invalid path.

            In order to avoid any confusion as to how to create the correct path, Node.js provides the path module. This module uses system-specific information to always return the correct value. So you can rewrite the previous example as:

            var fullPath = path.join(__dirname, "foo.js");

            This example doesn't need to include separators as path.join() will do it in the most appropriate manner. Alternately, you can use path.resolve() to retrieve the fully-qualified path:

            var fullPath = path.resolve(__dirname, "foo.js");

            Both path.join() and path.resolve() are suitable replacements for string concatenation wherever file or directory paths are being created.

            Rule Details

            This rule aims to prevent string concatenation of directory paths in Node.js

            Examples of incorrect code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = __dirname + "/foo.js";
            
            var fullPath = __filename + "/foo.js";

            Examples of correct code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = dirname + "/foo.js";

            When Not To Use It

            If you want to allow string concatenation of path names. Source: http://eslint.org/docs/rules/

            Expected return with your callback function.
            Open

                        next("Hacker!");
            Severity: Minor
            Found in modules/resources/spieler.js by eslint

            Enforce Return After Callback (callback-return)

            The callback pattern is at the heart of most I/O and event-driven programming in JavaScript.

            function doSomething(err, callback) {
                if (err) {
                    return callback(err);
                }
                callback();
            }

            To prevent calling the callback multiple times it is important to return anytime the callback is triggered outside of the main function body. Neglecting this technique often leads to issues where you do something more than once. For example, in the case of an HTTP request, you may try to send HTTP headers more than once leading Node.js to throw a Can't render headers after they are sent to the client. error.

            Rule Details

            This rule is aimed at ensuring that callbacks used outside of the main function block are always part-of or immediately preceding a return statement. This rule decides what is a callback based on the name of the function being called.

            Options

            The rule takes a single option - an array of possible callback names - which may include object methods. The default callback names are callback, cb, next.

            Default callback names

            Examples of incorrect code for this rule with the default ["callback", "cb", "next"] option:

            /*eslint callback-return: "error"*/
            
            function foo(err, callback) {
                if (err) {
                    callback(err);
                }
                callback();
            }

            Examples of correct code for this rule with the default ["callback", "cb", "next"] option:

            /*eslint callback-return: "error"*/
            
            function foo(err, callback) {
                if (err) {
                    return callback(err);
                }
                callback();
            }

            Supplied callback names

            Examples of incorrect code for this rule with the option ["done", "send.error", "send.success"]:

            /*eslint callback-return: ["error", ["done", "send.error", "send.success"]]*/
            
            function foo(err, done) {
                if (err) {
                    done(err);
                }
                done();
            }
            
            function bar(err, send) {
                if (err) {
                    send.error(err);
                }
                send.success();
            }

            Examples of correct code for this rule with the option ["done", "send.error", "send.success"]:

            /*eslint callback-return: ["error", ["done", "send.error", "send.success"]]*/
            
            function foo(err, done) {
                if (err) {
                    return done(err);
                }
                done();
            }
            
            function bar(err, send) {
                if (err) {
                    return send.error(err);
                }
                send.success();
            }

            Known Limitations

            Because it is difficult to understand the meaning of a program through static analysis, this rule has limitations:

            • false negatives when this rule reports correct code, but the program calls the callback more than one time (which is incorrect behavior)
            • false positives when this rule reports incorrect code, but the program calls the callback only one time (which is correct behavior)

            Passing the callback by reference

            The static analysis of this rule does not detect that the program calls the callback if it is an argument of a function (for example, setTimeout).

            Example of a false negative when this rule reports correct code:

            /*eslint callback-return: "error"*/
            
            function foo(err, callback) {
                if (err) {
                    setTimeout(callback, 0); // this is bad, but WILL NOT warn
                }
                callback();
            }

            Triggering the callback within a nested function

            The static analysis of this rule does not detect that the program calls the callback from within a nested function or an immediately-invoked function expression (IIFE).

            Example of a false negative when this rule reports correct code:

            /*eslint callback-return: "error"*/
            
            function foo(err, callback) {
                if (err) {
                    process.nextTick(function() {
                        return callback(); // this is bad, but WILL NOT warn
                    });
                }
                callback();
            }

            If/else statements

            The static analysis of this rule does not detect that the program calls the callback only one time in each branch of an if statement.

            Example of a false positive when this rule reports incorrect code:

            /*eslint callback-return: "error"*/
            
            function foo(err, callback) {
                if (err) {
                    callback(err); // this is fine, but WILL warn
                } else {
                    callback();    // this is fine, but WILL warn
                }
            }

            When Not To Use It

            There are some cases where you might want to call a callback function more than once. In those cases this rule may lead to incorrect behavior. In those cases you may want to reserve a special name for those callbacks and not include that in the list of callbacks that trigger warnings.

            Further Reading

            Related Rules

            Use path.join() or path.resolve() instead of + to create paths.
            Open

                tv = require(__dirname + "/share/iljig/tischValidator.js"),
            Severity: Minor
            Found in server.js by eslint

            Disallow string concatenation when using __dirname and __filename (no-path-concat)

            In Node.js, the __dirname and __filename global variables contain the directory path and the file path of the currently executing script file, respectively. Sometimes, developers try to use these variables to create paths to other files, such as:

            var fullPath = __dirname + "/foo.js";

            However, there are a few problems with this. First, you can't be sure what type of system the script is running on. Node.js can be run on any computer, including Windows, which uses a different path separator. It's very easy, therefore, to create an invalid path using string concatenation and assuming Unix-style separators. There's also the possibility of having double separators, or otherwise ending up with an invalid path.

            In order to avoid any confusion as to how to create the correct path, Node.js provides the path module. This module uses system-specific information to always return the correct value. So you can rewrite the previous example as:

            var fullPath = path.join(__dirname, "foo.js");

            This example doesn't need to include separators as path.join() will do it in the most appropriate manner. Alternately, you can use path.resolve() to retrieve the fully-qualified path:

            var fullPath = path.resolve(__dirname, "foo.js");

            Both path.join() and path.resolve() are suitable replacements for string concatenation wherever file or directory paths are being created.

            Rule Details

            This rule aims to prevent string concatenation of directory paths in Node.js

            Examples of incorrect code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = __dirname + "/foo.js";
            
            var fullPath = __filename + "/foo.js";

            Examples of correct code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = dirname + "/foo.js";

            When Not To Use It

            If you want to allow string concatenation of path names. Source: http://eslint.org/docs/rules/

            Use path.join() or path.resolve() instead of + to create paths.
            Open

                        addPath: __dirname + "/locales/{{lng}}/{{ns}}.missing.json",
            Severity: Minor
            Found in server.js by eslint

            Disallow string concatenation when using __dirname and __filename (no-path-concat)

            In Node.js, the __dirname and __filename global variables contain the directory path and the file path of the currently executing script file, respectively. Sometimes, developers try to use these variables to create paths to other files, such as:

            var fullPath = __dirname + "/foo.js";

            However, there are a few problems with this. First, you can't be sure what type of system the script is running on. Node.js can be run on any computer, including Windows, which uses a different path separator. It's very easy, therefore, to create an invalid path using string concatenation and assuming Unix-style separators. There's also the possibility of having double separators, or otherwise ending up with an invalid path.

            In order to avoid any confusion as to how to create the correct path, Node.js provides the path module. This module uses system-specific information to always return the correct value. So you can rewrite the previous example as:

            var fullPath = path.join(__dirname, "foo.js");

            This example doesn't need to include separators as path.join() will do it in the most appropriate manner. Alternately, you can use path.resolve() to retrieve the fully-qualified path:

            var fullPath = path.resolve(__dirname, "foo.js");

            Both path.join() and path.resolve() are suitable replacements for string concatenation wherever file or directory paths are being created.

            Rule Details

            This rule aims to prevent string concatenation of directory paths in Node.js

            Examples of incorrect code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = __dirname + "/foo.js";
            
            var fullPath = __filename + "/foo.js";

            Examples of correct code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = dirname + "/foo.js";

            When Not To Use It

            If you want to allow string concatenation of path names. Source: http://eslint.org/docs/rules/

            Use path.join() or path.resolve() instead of + to create paths.
            Open

            app.use("apple-touch-icon-precomposed.png", express.static(__dirname + "/public/images/icon_100.png"));
            Severity: Minor
            Found in server.js by eslint

            Disallow string concatenation when using __dirname and __filename (no-path-concat)

            In Node.js, the __dirname and __filename global variables contain the directory path and the file path of the currently executing script file, respectively. Sometimes, developers try to use these variables to create paths to other files, such as:

            var fullPath = __dirname + "/foo.js";

            However, there are a few problems with this. First, you can't be sure what type of system the script is running on. Node.js can be run on any computer, including Windows, which uses a different path separator. It's very easy, therefore, to create an invalid path using string concatenation and assuming Unix-style separators. There's also the possibility of having double separators, or otherwise ending up with an invalid path.

            In order to avoid any confusion as to how to create the correct path, Node.js provides the path module. This module uses system-specific information to always return the correct value. So you can rewrite the previous example as:

            var fullPath = path.join(__dirname, "foo.js");

            This example doesn't need to include separators as path.join() will do it in the most appropriate manner. Alternately, you can use path.resolve() to retrieve the fully-qualified path:

            var fullPath = path.resolve(__dirname, "foo.js");

            Both path.join() and path.resolve() are suitable replacements for string concatenation wherever file or directory paths are being created.

            Rule Details

            This rule aims to prevent string concatenation of directory paths in Node.js

            Examples of incorrect code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = __dirname + "/foo.js";
            
            var fullPath = __filename + "/foo.js";

            Examples of correct code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = dirname + "/foo.js";

            When Not To Use It

            If you want to allow string concatenation of path names. Source: http://eslint.org/docs/rules/

            Expected return with your callback function.
            Open

                        next();
            Severity: Minor
            Found in modules/resources/spiel.js by eslint

            Enforce Return After Callback (callback-return)

            The callback pattern is at the heart of most I/O and event-driven programming in JavaScript.

            function doSomething(err, callback) {
                if (err) {
                    return callback(err);
                }
                callback();
            }

            To prevent calling the callback multiple times it is important to return anytime the callback is triggered outside of the main function body. Neglecting this technique often leads to issues where you do something more than once. For example, in the case of an HTTP request, you may try to send HTTP headers more than once leading Node.js to throw a Can't render headers after they are sent to the client. error.

            Rule Details

            This rule is aimed at ensuring that callbacks used outside of the main function block are always part-of or immediately preceding a return statement. This rule decides what is a callback based on the name of the function being called.

            Options

            The rule takes a single option - an array of possible callback names - which may include object methods. The default callback names are callback, cb, next.

            Default callback names

            Examples of incorrect code for this rule with the default ["callback", "cb", "next"] option:

            /*eslint callback-return: "error"*/
            
            function foo(err, callback) {
                if (err) {
                    callback(err);
                }
                callback();
            }

            Examples of correct code for this rule with the default ["callback", "cb", "next"] option:

            /*eslint callback-return: "error"*/
            
            function foo(err, callback) {
                if (err) {
                    return callback(err);
                }
                callback();
            }

            Supplied callback names

            Examples of incorrect code for this rule with the option ["done", "send.error", "send.success"]:

            /*eslint callback-return: ["error", ["done", "send.error", "send.success"]]*/
            
            function foo(err, done) {
                if (err) {
                    done(err);
                }
                done();
            }
            
            function bar(err, send) {
                if (err) {
                    send.error(err);
                }
                send.success();
            }

            Examples of correct code for this rule with the option ["done", "send.error", "send.success"]:

            /*eslint callback-return: ["error", ["done", "send.error", "send.success"]]*/
            
            function foo(err, done) {
                if (err) {
                    return done(err);
                }
                done();
            }
            
            function bar(err, send) {
                if (err) {
                    return send.error(err);
                }
                send.success();
            }

            Known Limitations

            Because it is difficult to understand the meaning of a program through static analysis, this rule has limitations:

            • false negatives when this rule reports correct code, but the program calls the callback more than one time (which is incorrect behavior)
            • false positives when this rule reports incorrect code, but the program calls the callback only one time (which is correct behavior)

            Passing the callback by reference

            The static analysis of this rule does not detect that the program calls the callback if it is an argument of a function (for example, setTimeout).

            Example of a false negative when this rule reports correct code:

            /*eslint callback-return: "error"*/
            
            function foo(err, callback) {
                if (err) {
                    setTimeout(callback, 0); // this is bad, but WILL NOT warn
                }
                callback();
            }

            Triggering the callback within a nested function

            The static analysis of this rule does not detect that the program calls the callback from within a nested function or an immediately-invoked function expression (IIFE).

            Example of a false negative when this rule reports correct code:

            /*eslint callback-return: "error"*/
            
            function foo(err, callback) {
                if (err) {
                    process.nextTick(function() {
                        return callback(); // this is bad, but WILL NOT warn
                    });
                }
                callback();
            }

            If/else statements

            The static analysis of this rule does not detect that the program calls the callback only one time in each branch of an if statement.

            Example of a false positive when this rule reports incorrect code:

            /*eslint callback-return: "error"*/
            
            function foo(err, callback) {
                if (err) {
                    callback(err); // this is fine, but WILL warn
                } else {
                    callback();    // this is fine, but WILL warn
                }
            }

            When Not To Use It

            There are some cases where you might want to call a callback function more than once. In those cases this rule may lead to incorrect behavior. In those cases you may want to reserve a special name for those callbacks and not include that in the list of callbacks that trigger warnings.

            Further Reading

            Related Rules

            Use path.join() or path.resolve() instead of + to create paths.
            Open

                spieler = require(__dirname + "/modules/resources/spieler.js"),
            Severity: Minor
            Found in server.js by eslint

            Disallow string concatenation when using __dirname and __filename (no-path-concat)

            In Node.js, the __dirname and __filename global variables contain the directory path and the file path of the currently executing script file, respectively. Sometimes, developers try to use these variables to create paths to other files, such as:

            var fullPath = __dirname + "/foo.js";

            However, there are a few problems with this. First, you can't be sure what type of system the script is running on. Node.js can be run on any computer, including Windows, which uses a different path separator. It's very easy, therefore, to create an invalid path using string concatenation and assuming Unix-style separators. There's also the possibility of having double separators, or otherwise ending up with an invalid path.

            In order to avoid any confusion as to how to create the correct path, Node.js provides the path module. This module uses system-specific information to always return the correct value. So you can rewrite the previous example as:

            var fullPath = path.join(__dirname, "foo.js");

            This example doesn't need to include separators as path.join() will do it in the most appropriate manner. Alternately, you can use path.resolve() to retrieve the fully-qualified path:

            var fullPath = path.resolve(__dirname, "foo.js");

            Both path.join() and path.resolve() are suitable replacements for string concatenation wherever file or directory paths are being created.

            Rule Details

            This rule aims to prevent string concatenation of directory paths in Node.js

            Examples of incorrect code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = __dirname + "/foo.js";
            
            var fullPath = __filename + "/foo.js";

            Examples of correct code for this rule:

            /*eslint no-path-concat: "error"*/
            
            var fullPath = dirname + "/foo.js";

            When Not To Use It

            If you want to allow string concatenation of path names. Source: http://eslint.org/docs/rules/

            Severity
            Category
            Status
            Source
            Language