Samisdat/ddns

View on GitHub

Showing 14 of 22 total issues

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

module.exports = function (grunt) {

    var key = require('./key')(grunt);

    var backupConfLocal = function(){
Severity: Major
Found in grunt/lib/server.js - About 5 hrs to fix

    Function config has 110 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var config = (function() {
    
        var configFilePath = '/ddns/config.json';
    
        var nameServer;
    Severity: Major
    Found in grunt/lib/config.js - About 4 hrs to fix

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

      module.exports = function (grunt) {
      
          var createUpdateMessageScript = function(){
      
              var deferred = q.defer();
      Severity: Major
      Found in grunt/lib/client.js - About 3 hrs to fix

        Function config has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

        var config = (function() {
        
            var configFilePath = '/ddns/config.json';
        
            var nameServer;
        Severity: Minor
        Found in grunt/lib/config.js - About 3 hrs 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 exports has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function (grunt) {
        
            var createKeyDir = function(){
                if (true === fs.existsSync('/ddns/key')){
                    return q.resolve();
        Severity: Major
        Found in grunt/lib/key.js - About 3 hrs to fix

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

          module.exports = function (grunt) {
          
              var server = require('./lib/server')(grunt);
          
              grunt.registerTask('server:create_key', 'create key', function() {
          Severity: Major
          Found in grunt/server.js - About 2 hrs to fix

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

            var promiseToExec = function(gruntLog, cmd, message, timeout, debug){
            
                var deferred = q.defer();
            
                if (undefined === gruntLog){
            Severity: Major
            Found in grunt/lib/qexec.js - About 2 hrs to fix

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

                  var createUpdateMessageScript = function(){
              
                      var deferred = q.defer();
              
                      qfs.fileExists('/ddns/client/create-update-message.sh')
              Severity: Minor
              Found in grunt/lib/client.js - About 1 hr to fix

                Function firstSetup has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var firstSetup = function(nameServer, domains){
                
                        var deferred = q.defer();
                
                
                
                Severity: Minor
                Found in grunt/lib/server.js - About 1 hr to fix

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

                      var readKey = function(){
                          var deferred = q.defer();
                  
                          qfs.readdir('/ddns/key')
                          .then(function(files){
                  Severity: Minor
                  Found in grunt/lib/key.js - About 1 hr to fix

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

                        var createClient = function(){
                    
                            var deferred = q.defer();
                            qexec(grunt.log, 'mkdir -p /ddns/client', 'create dir for client', 0, true)
                            .then(function () {
                    Severity: Minor
                    Found in grunt/lib/client.js - About 1 hr to fix

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

                      var promiseToExec = function(gruntLog, cmd, message, timeout, debug){
                      
                          var deferred = q.defer();
                      
                          if (undefined === gruntLog){
                      Severity: Minor
                      Found in grunt/lib/qexec.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

                      Function promiseToExec has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      var promiseToExec = function(gruntLog, cmd, message, timeout, debug){
                      Severity: Minor
                      Found in grunt/lib/qexec.js - About 35 mins to fix

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

                        module.exports = function (grunt) {
                        
                            var key = require('./key')(grunt);
                        
                            var backupConfLocal = function(){
                        Severity: Minor
                        Found in grunt/lib/server.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

                        Severity
                        Category
                        Status
                        Source
                        Language