antimalware/manul

View on GitHub

Showing 400 of 400 total issues

Function init has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
Open

}(this, function init($, undefined) {

  "use strict";

  // the base DOM structure needed to create a modal
Severity: Minor
Found in src/scanner/static/js/bootbox.js - About 1 day 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 zip.js has 677 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 Copyright (c) 2013 Gildas Lormeau. All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
Severity: Major
Found in src/log_analyzer/js/zip.js - About 1 day to fix

    Function proc has 302 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            that.proc = function(s, z, r) {
                var j; // temporary storage
                var tindex; // temporary pointer
                var e; // extra bits or operation
                var b = 0; // bit buffer
    Severity: Major
    Found in src/log_analyzer/js/inflate.js - About 1 day to fix

      Function InfTree has 234 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function InfTree() {
              var that = this;
      
              var hn; // hufts used in space
              var v; // work area for huft_build
      Severity: Major
      Found in src/log_analyzer/js/inflate.js - About 1 day to fix

        File bootbox.js has 553 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * bootbox.js [master branch]
         *
         * http://bootboxjs.com/license.txt
         */
        Severity: Major
        Found in src/scanner/static/js/bootbox.js - About 1 day to fix

          Function create has 220 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              create = function() {
                  var curOptions = {
                          trackCircularDependencies : true,
                          allowMultipleDeclarations : true,
                          onError                   : function(e) {
          Severity: Major
          Found in src/log_analyzer/js/analyzer.table.js - About 1 day to fix

            Function Inflate has 202 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function Inflate() {
                    var that = this;
            
                    that.mode = 0; // current inflate mode
            
            
            Severity: Major
            Found in src/log_analyzer/js/inflate.js - About 1 day to fix

              Function inflate_fast has 190 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function inflate_fast(bl, bd, tl, tl_index, td, td_index, s, z) {
                          var t; // temporary pointer
                          var tp; // temporary pointer
                          var tp_index; // temporary pointer
                          var e; // extra bits or operation
              Severity: Major
              Found in src/log_analyzer/js/inflate.js - About 7 hrs to fix

                File zip-fs.js has 458 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*
                 Copyright (c) 2013 Gildas Lormeau. All rights reserved.
                
                 Redistribution and use in source and binary forms, with or without
                 modification, are permitted provided that the following conditions are met:
                Severity: Minor
                Found in src/log_analyzer/js/zip-fs.js - About 7 hrs to fix

                  Function startExecutor has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function startExecutor()
                      {
                          $view = new View();
                          $healer = new Healer();
                  
                  
                  Severity: Minor
                  Found in src/scanner/classes/ExecutorController.inc.php - About 6 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

                                              } else if ((e & 64) === 0) {
                                                  t += tp[tp_index_t_3 + 2];
                                                  t += (b & inflate_mask[e]);
                                                  tp_index_t_3 = (tp_index + t) * 3;
                                                  e = tp[tp_index_t_3];
                  Severity: Major
                  Found in src/log_analyzer/js/inflate.js and 1 other location - About 6 hrs to fix
                  src/log_analyzer/js/inflate.js on lines 680..713

                  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 157.

                  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

                                      } else if ((e & 32) !== 0) {
                  
                                          c = z.avail_in - n;
                                          c = (k >> 3) < c ? k >> 3 : c;
                                          n += c;
                  Severity: Major
                  Found in src/log_analyzer/js/inflate.js and 1 other location - About 6 hrs to fix
                  src/log_analyzer/js/inflate.js on lines 640..662

                  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 157.

                  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 4 locations. Consider refactoring.
                  Open

                                          while (k < (3)) {
                                              if (n !== 0) {
                                                  r = Z_OK;
                                              } else {
                                                  that.bitb = b;
                  Severity: Major
                  Found in src/log_analyzer/js/inflate.js and 3 other locations - About 6 hrs to fix
                  src/log_analyzer/js/inflate.js on lines 1256..1271
                  src/log_analyzer/js/inflate.js on lines 1337..1352
                  src/log_analyzer/js/inflate.js on lines 1425..1441

                  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 156.

                  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 4 locations. Consider refactoring.
                  Open

                                      while (k < (32)) {
                                          if (n !== 0) {
                                              r = Z_OK;
                                          } else {
                                              that.bitb = b;
                  Severity: Major
                  Found in src/log_analyzer/js/inflate.js and 3 other locations - About 6 hrs to fix
                  src/log_analyzer/js/inflate.js on lines 1256..1271
                  src/log_analyzer/js/inflate.js on lines 1425..1441
                  src/log_analyzer/js/inflate.js on lines 1475..1490

                  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 156.

                  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 4 locations. Consider refactoring.
                  Open

                                      while (k < (14)) {
                                          if (n !== 0) {
                                              r = Z_OK;
                                          } else {
                                              that.bitb = b;
                  Severity: Major
                  Found in src/log_analyzer/js/inflate.js and 3 other locations - About 6 hrs to fix
                  src/log_analyzer/js/inflate.js on lines 1256..1271
                  src/log_analyzer/js/inflate.js on lines 1337..1352
                  src/log_analyzer/js/inflate.js on lines 1475..1490

                  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 156.

                  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 4 locations. Consider refactoring.
                  Open

                                      while (k < (3)) {
                                          if (n !== 0) {
                                              r = Z_OK;
                                          } else {
                                              that.bitb = b;
                  Severity: Major
                  Found in src/log_analyzer/js/inflate.js and 3 other locations - About 6 hrs to fix
                  src/log_analyzer/js/inflate.js on lines 1337..1352
                  src/log_analyzer/js/inflate.js on lines 1425..1441
                  src/log_analyzer/js/inflate.js on lines 1475..1490

                  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 156.

                  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

                  File localization.js has 415 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  var localization = {
                  
                      browser_language: 'en',
                      chosen_language: 'en',
                  
                  Severity: Minor
                  Found in src/log_analyzer/js/localization.js - About 5 hrs to fix

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

                    <?php
                    
                    define('MANUL_LANG_ID_RU', 'ru');
                    define('MANUL_LANG_ID_EN', 'en');
                    define('MANUL_LANG_ID_UA', 'uk');
                    Severity: Minor
                    Found in src/scanner/classes/Localization.inc.php - About 5 hrs to fix

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

                                          while (k < (j)) {
                                              if (n !== 0)
                                                  r = Z_OK;
                                              else {
                      
                      
                      Severity: Major
                      Found in src/log_analyzer/js/inflate.js and 3 other locations - About 5 hrs to fix
                      src/log_analyzer/js/inflate.js on lines 800..816
                      src/log_analyzer/js/inflate.js on lines 890..906
                      src/log_analyzer/js/inflate.js on lines 940..956

                      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 153.

                      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 4 locations. Consider refactoring.
                      Open

                                          while (k < (j)) {
                                              if (n !== 0)
                                                  r = Z_OK;
                                              else {
                      
                      
                      Severity: Major
                      Found in src/log_analyzer/js/inflate.js and 3 other locations - About 5 hrs to fix
                      src/log_analyzer/js/inflate.js on lines 800..816
                      src/log_analyzer/js/inflate.js on lines 860..876
                      src/log_analyzer/js/inflate.js on lines 890..906

                      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 153.

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language