antimalware/manul

View on GitHub
src/log_analyzer/js/analyzer.tableBuilder.js

Summary

Maintainability
D
1 day
Test Coverage

File analyzer.tableBuilder.js has 361 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var logLoaded = false;
var filesDataTable = null;
var numberItemsInFilter;

var data = "";
Severity: Minor
Found in src/log_analyzer/js/analyzer.tableBuilder.js - About 4 hrs to fix

    Function buildTable has 98 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function buildTable(data) {
        window.filesDataTable = $('#filesTable').dataTable({
           "order": [[ 0, "desc" ]],
    
           "aLengthMenu": [[100, 10, 500, -1], [100, 10, 500, "All"]],
    Severity: Major
    Found in src/log_analyzer/js/analyzer.tableBuilder.js - About 3 hrs to fix

      Consider simplifying this complex logical expression.
      Open

              if ( ( minDateStr == '' && '' == maxDateStr ) ||
                   ( minDateStr == '' && date <= maxDate ) ||
                   ( minDate <= date && '' == maxDateStr ) ||
                   ( minDate <= date && date <= maxDate ) )
              {      
      Severity: Critical
      Found in src/log_analyzer/js/analyzer.tableBuilder.js - About 1 hr to fix

        Function base64_decode has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function base64_decode(data) {
          if (!data)
             return "";
        
          //  discuss at: http://phpjs.org/functions/base64_decode/
        Severity: Minor
        Found in src/log_analyzer/js/analyzer.tableBuilder.js - About 1 hr to fix

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

          function parseWebsiteLog(fileDictDict) {
              var fileInfoArrayArray = new Array;
              for(var fileDictName in fileDictDict) {
                  var fileInfoArray = new Array;
                  var fileDict = fileDictDict[fileDictName];
          Severity: Minor
          Found in src/log_analyzer/js/analyzer.tableBuilder.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 parseWebsiteLog has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function parseWebsiteLog(fileDictDict) {
              var fileInfoArrayArray = new Array;
              for(var fileDictName in fileDictDict) {
                  var fileInfoArray = new Array;
                  var fileDict = fileDictDict[fileDictName];
          Severity: Minor
          Found in src/log_analyzer/js/analyzer.tableBuilder.js - About 1 hr to fix

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

            function displayContents(xmlStr) {
                if (logLoaded) {
                    //loading filters from files                       
                    new_json = "";
                    signature = xmlStr.substring(0, 16).replace(/\s/, '');
            Severity: Minor
            Found in src/log_analyzer/js/analyzer.tableBuilder.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 base64_decode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function base64_decode(data) {
              if (!data)
                 return "";
            
              //  discuss at: http://phpjs.org/functions/base64_decode/
            Severity: Minor
            Found in src/log_analyzer/js/analyzer.tableBuilder.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 buildTable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function buildTable(data) {
                window.filesDataTable = $('#filesTable').dataTable({
                   "order": [[ 0, "desc" ]],
            
                   "aLengthMenu": [[100, 10, 500, -1], [100, 10, 500, "All"]],
            Severity: Minor
            Found in src/log_analyzer/js/analyzer.tableBuilder.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

            There are no issues that match your filters.

            Category
            Status