lagranovskiy/j316-translator

View on GitHub

Showing 28 of 97 total issues

Function singleJob has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                    var singleJob = function (jobCallback) {
                        dbt.getVersInLang(damId, verseJob.bookId, verseJob.chapterId, verseJob.verseStart, verseJob.verseEnd,
                            function (error, translatedArray) {
                                if (error) {
                                    console.info('VerseWorker :: Cannot process verse lookup to ' + targetLanguage + ' for verse: ' + verse + ' : ' + error);
Severity: Minor
Found in app/provider/BibleVerseWorker.js - About 1 hr to fix

    Function dbtConnector has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    var dbtConnector = function () {
    
        var service = {
            /**
             * Returns vers with given parameters fetched from dbt.io
    Severity: Minor
    Found in app/provider/connectors/DbtConnector.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 protokollService has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    var protokollService = function() {
    
        var controller = {
    
            /**
    Severity: Minor
    Found in app/service/ProtokollService.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 showSettings has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            $scope.showSettings = function (ev) {
                $mdDialog.show({
                        controller: function ($scope, $mdDialog) {
                            $scope.settings = TranslationService.getSettings();
                            $scope.hide = function () {
    Severity: Minor
    Found in public/consumer/js/controllers/NavController.js - About 1 hr to fix

      Avoid deeply nested control flow statements.
      Open

                                      if (!$scope.message.text) {
                                          $scope.message.text = '';
                                      }
      Severity: Major
      Found in public/sender/js/controllers/TranslationController.js - About 45 mins to fix

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

        var protocolService = function() {
        
            var cache = new NodeCache({
                stdTTL: 60 * 60 * 18,
                checkperiod: 60 * 60 * 3
        Severity: Minor
        Found in app/business/ProtokollDistributor.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 getVersInLang has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                getVersInLang: function (damId, bookId, chapterId, verseStart, verse_end, callback) {
        Severity: Minor
        Found in app/provider/connectors/DbtConnector.js - About 45 mins to fix

          Function postmarkConnector has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          var postmarkConnector = function() {
          
              var client = new postmark.Client(config.keys.postmark.apiToken);
          
              var service = {
          Severity: Minor
          Found in app/provider/connectors/PostmarkConnector.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

          Severity
          Category
          Status
          Source
          Language