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(){
Function config
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
var config = (function() {
var configFilePath = '/ddns/config.json';
var nameServer;
Function exports
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
var createUpdateMessageScript = function(){
var deferred = q.defer();
Function config
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
var config = (function() {
var configFilePath = '/ddns/config.json';
var nameServer;
- Read upRead up
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();
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() {
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){
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')
Function firstSetup
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var firstSetup = function(nameServer, domains){
var deferred = q.defer();
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){
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 () {
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){
- Read upRead up
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){
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(){
- Read upRead up
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"