antimalware/manul

View on GitHub

Showing 400 of 400 total issues

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

    Function folderWalker has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        private function folderWalker($path, &$files_found)
        {
            if ($path === '.')
                $path = $_SERVER['DOCUMENT_ROOT'];
    
    
    Severity: Minor
    Found in src/scanner/classes/FileList.inc.php - 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

    File MalwareDetector.inc.php has 327 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    ob_start();
    require_once('XmlValidator.inc.php');
    require_once('FileInfo.inc.php');
    Severity: Minor
    Found in src/scanner/classes/MalwareDetector.inc.php - About 3 hrs to fix

      Function HashTable has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

      function HashTable(obj)
      {
          this.length = 0;
          this.items = {};
          for (var p in obj) {
      Severity: Minor
      Found in src/log_analyzer/js/HashTable.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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

                  var head = doc.getElementsByTagName('head')[0],
                      createScript = function() {
                          var script = doc.createElement('script');
                          script.onreadystatechange = function() {
                              script.parentNode.removeChild(script);
      Severity: Major
      Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 3 hrs to fix
      src/log_analyzer/js/analyzer.table.js on lines 1558..1567

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 109.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              var head = doc.getElementsByTagName('head')[0],
                  createScript = function() {
                      var script = doc.createElement('script');
                      script.onreadystatechange = function() {
                          script.parentNode.removeChild(script);
      Severity: Major
      Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 3 hrs to fix
      src/log_analyzer/js/analyzer.table.js on lines 378..387

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 109.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          public function start()
          {
              global $projectTmpDir, $php_errormsg;
      
              $authenticator = new Auth();
      Severity: Minor
      Found in src/scanner/classes/ScannerController.inc.php - 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                          if (s.read != s.write) {
                              s.bitb = b;
                              s.bitk = k;
                              z.avail_in = n;
                              z.total_in += p - z.next_in_index;
      Severity: Major
      Found in src/log_analyzer/js/inflate.js and 1 other location - About 3 hrs to fix
      src/log_analyzer/js/inflate.js on lines 1678..1686

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 105.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                          if (that.read != that.write) {
                              that.bitb = b;
                              that.bitk = k;
                              z.avail_in = n;
                              z.total_in += p - z.next_in_index;
      Severity: Major
      Found in src/log_analyzer/js/inflate.js and 1 other location - About 3 hrs to fix
      src/log_analyzer/js/inflate.js on lines 1054..1062

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 105.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function deflate has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              that.deflate = function(_strm, flush) {
                  var i, header, level_flags, old_flush, bstate;
      
                  if (flush > Z_FINISH || flush < 0) {
                      return Z_STREAM_ERROR;
      Severity: Major
      Found in src/log_analyzer/js/deflate.js - About 3 hrs to fix

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                        case DICT4:
        
                            if (z.avail_in === 0)
                                return r;
                            r = f;
        Severity: Major
        Found in src/log_analyzer/js/inflate.js and 2 other locations - About 3 hrs to fix
        src/log_analyzer/js/inflate.js on lines 1884..1893
        src/log_analyzer/js/inflate.js on lines 1894..1903

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                        case DICT3:
        
                            if (z.avail_in === 0)
                                return r;
                            r = f;
        Severity: Major
        Found in src/log_analyzer/js/inflate.js and 2 other locations - About 3 hrs to fix
        src/log_analyzer/js/inflate.js on lines 1874..1883
        src/log_analyzer/js/inflate.js on lines 1894..1903

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                        case DICT2:
        
                            if (z.avail_in === 0)
                                return r;
                            r = f;
        Severity: Major
        Found in src/log_analyzer/js/inflate.js and 2 other locations - About 3 hrs to fix
        src/log_analyzer/js/inflate.js on lines 1874..1883
        src/log_analyzer/js/inflate.js on lines 1884..1893

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function dialog has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          exports.dialog = function(options) {
            options = sanitize(options);
        
            var dialog = $(templates.dialog);
            var innerDialog = dialog.find(".modal-dialog");
        Severity: Major
        Found in src/scanner/static/js/bootbox.js - About 3 hrs to fix

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                          case BADBLOCKS:
                              r = Z_DATA_ERROR;
          
                              that.bitb = b;
                              that.bitk = k;
          Severity: Major
          Found in src/log_analyzer/js/inflate.js and 2 other locations - About 3 hrs to fix
          src/log_analyzer/js/inflate.js on lines 1064..1072
          src/log_analyzer/js/inflate.js on lines 1688..1697

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 97.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                          case END:
                              r = Z_STREAM_END;
                              s.bitb = b;
                              s.bitk = k;
                              z.avail_in = n;
          Severity: Major
          Found in src/log_analyzer/js/inflate.js and 2 other locations - About 3 hrs to fix
          src/log_analyzer/js/inflate.js on lines 1688..1697
          src/log_analyzer/js/inflate.js on lines 1698..1707

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 97.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                          case DONELOCKS:
                              r = Z_STREAM_END;
          
                              that.bitb = b;
                              that.bitk = k;
          Severity: Major
          Found in src/log_analyzer/js/inflate.js and 2 other locations - About 3 hrs to fix
          src/log_analyzer/js/inflate.js on lines 1064..1072
          src/log_analyzer/js/inflate.js on lines 1698..1707

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 97.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Function deflate_slow has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function deflate_slow(flush) {
                      // short hash_head = 0; // head of hash chain
                      var hash_head = 0; // head of hash chain
                      var bflush; // set if current block must be flushed
                      var max_insert;
          Severity: Major
          Found in src/log_analyzer/js/deflate.js - About 3 hrs to fix

            Method startExecutor has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function startExecutor()
                {
                    $view = new View();
                    $healer = new Healer();
            
            
            Severity: Major
            Found in src/scanner/classes/ExecutorController.inc.php - About 3 hrs to fix

              Method detectMalware has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function detectMalware($filePath, &$foundFragment, &$pos, $startTime, $timeout, $ext)
                  {
              
                      if (filesize($filePath) > $this->MAX_FILESIZE) {
                          return 'skipped';
              Severity: Major
              Found in src/scanner/classes/MalwareDetector.inc.php - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language