Showing 28 of 97 total issues
Function senderConnector
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
Open
var senderConnector = function(socketChannel) {
socketChannel.on('connection', function(socket) {
- 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 senderConnector
has 196 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var senderConnector = function(socketChannel) {
socketChannel.on('connection', function(socket) {
Function consumerConnector
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
Open
var consumerConnector = function (socketChannel) {
/**
* Socket server for handlich translation service
- 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 consumerConnector
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var consumerConnector = function (socketChannel) {
/**
* Socket server for handlich translation service
Function translationWorker
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var translationWorker = function () {
var worker = {
File TranslationController.js
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
angular.module('j316.translate.controller.translation', ['angular-underscore'])
.controller('TranslationPanelCtrl', function($scope, $location, $timeout, $log, TranslationService, QuestionService, languages, $mdDialog, $mdMedia, $mdToast) {
$scope.showLastMsgCount = 20;
$scope.messages = [];
Function requestTranslation
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
requestTranslation: function (text, sourceLanguage, translationSource) {
if (!text) {
console.error('Service :: Cannot request a translation of null');
return;
}
Function protocolService
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var protocolService = function() {
var cache = new NodeCache({
stdTTL: 60 * 60 * 18,
checkperiod: 60 * 60 * 3
Function startVoiceRecognition
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.startVoiceRecognition = function() {
if (!('webkitSpeechRecognition' in window)) {
$log.log("webkitSpeechRecognition is not available");
}
else {
File app.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
angular.module('senderApp', [
'ngCookies',
Function verseQueue
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
verseQueue: async.queue(function (job, callback) {
var lookupJobArray = job.verseJobs;
var targetLanguage = job.targetLanguage;
var verse = job.verse;
Function dbtConnector
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var dbtConnector = function () {
var service = {
/**
* Returns vers with given parameters fetched from dbt.io
Function getVersInLang
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getVersInLang: function (damId, bookId, chapterId, verseStart, verse_end, callback) {
if (!damId) {
console.info('dbtConnector :: no damID given.');
return callback('Unknown translation');
}
Function prepareVerseLookup
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
prepareVerseLookup: function (senderLanguage, verse, callback) {
refParser.parseOSIS(senderLanguage, verse, function (err, refInfoArray) {
if (!refInfoArray || refInfoArray.length == 0) {
return callback('VerseWorker :: no parsing of verse possible');
}
Function protokollService
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var protokollService = function() {
var controller = {
/**
Function distributeProtokoll
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
distributeProtokoll: function(protokollDate, recipientList, callback) {
async.waterfall([function(asyncCallback) {
// Get protokoll internally
Function yandexTranslator
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var yandexTranslator = function () {
var service = {
/**
Function exports
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(app) {
var errorHandler = function(err, req, res, next) {
console.error(err.stack);
Function submitQuestionAnswer
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
submitQuestionAnswer: function (answer, questionUUID, senderName, senderLanguage) {
var question = this.msgCache.get(questionUUID);
if (!question) {
console.error('Cannot find msg with uuid ' + questionUUID + ' answer not accepted.');
return;
Function postmarkConnector
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var postmarkConnector = function() {
var client = new postmark.Client(config.keys.postmark.apiToken);
var service = {