bitslip6/bitfire

View on GitHub

Showing 117 of 749 total issues

Effect has 30 functions (exceeds 20 allowed). Consider refactoring.
Open

class Effect {
    private $out = '';
    private $cookie = '';
    private $response = 0;
    private $hide_output = false;
Severity: Minor
Found in firewall/src/util.php - About 3 hrs to fix

    DB has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class DB {
        protected $_db;
        public $errors;
        public $logs = [];
        public $host;
    Severity: Minor
    Found in firewall/src/db.php - About 2 hrs to fix

      MaybeA has 22 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class MaybeA implements MaybeI {
          protected $_x;
          protected $_errors;
          /** @var MaybeA */
          public static $FALSE;
      Severity: Minor
      Found in firewall/src/util.php - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

        if(f=f||" "!==h[0],d.push(i),e++,"+"===h[0])for(g=!0;"+"===h[0];)c.push(h),h=a.lines[++a.index];i.substr(1)===h.substr(1)?(c.push(h),a.index++):g=!0}if("+"===(b[e]||"")[0]&&f&&(g=!0),g)return c;for(;e<b.length;)d.push(b[e++]);return{merged:d,changes:c}}function t(a){return a.reduce(function(a,b){return a&&"-"===b[0]},!0)}function u(a,b,c){for(var d=0;d<c;d++){var e=b[b.length-c+d].substr(1);if(a.lines[a.index+d]!==" "+e)return!1}return a.index+=c,!0}function v(a){var b=0,c=0;return a.forEach(function(a){if("string"!=typeof a){var d=v(a.mine),e=v(a.theirs);void 0!==b&&(d.oldLines===e.oldLines?b+=d.oldLines:b=void 0),void 0!==c&&(d.newLines===e.newLines?c+=d.newLines:c=void 0)}else void 0===c||"+"!==a[0]&&" "!==a[0]||c++,void 0===b||"-"!==a[0]&&" "!==a[0]||b++}),{oldLines:b,newLines:c}}b.__esModule=!0,b.calcLineCount=e,/*istanbul ignore start*/
        Severity: Critical
        Found in firewall/views/diff.min.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&
                                         isFunction$1(bCtor) && bCtor instanceof bCtor)
                                    && ('constructor' in a && 'constructor' in b)) {
                  return false;
                }
          Severity: Major
          Found in public/underscore.js - About 1 hr to fix

            Function f has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            r(/*istanbul ignore end*/s);return{oldFileName:a,newFileName:b,oldHeader:f,newHeader:g,hunks:l}}function f(a,b,c,d,f,g,h){var i=e(a,b,c,d,f,g,h),j=[];a==b&&j.push("Index: "+a),j.push("==================================================================="),j.push("--- "+i.oldFileName+("undefined"==typeof i.oldHeader?"":"\t"+i.oldHeader)),j.push("+++ "+i.newFileName+("undefined"==typeof i.newHeader?"":"\t"+i.newHeader));for(var k=0;k<i.hunks.length;k++){var l=i.hunks[k];j.push("@@ -"+l.oldStart+","+l.oldLines+" +"+l.newStart+","+l.newLines+" @@"),j.push.apply(j,l.lines)}return j.join("\n")+"\n"}function g(a,b,c,d,e,g){return f(a,a,b,c,d,e,g)}b.__esModule=!0,b.structuredPatch=e,/*istanbul ignore start*/
            Severity: Major
            Found in firewall/views/diff.min.js - About 50 mins to fix

              Function e has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function e(a,b,c,e,f,g,i){// Append an empty value to make cleanup easier
              Severity: Major
              Found in firewall/views/diff.min.js - About 50 mins to fix

                Method block_now has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function block_now(int $code, string $parameter, string $value, string $pattern, int $block_time = 0, ?Request $req = null, ?string $custom_err = null) : Effect {
                Severity: Major
                Found in firewall/src/bitfire.php - About 50 mins to fix

                  Method malware_creator has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function malware_creator(string $path, string $per_unknown, bool $php_count, $frequency, $max_len, $size, $known): callable
                  Severity: Major
                  Found in firewall/src/cms.php - About 50 mins to fix

                    Method new_block has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public static function new_block(int $code, string $parameter, string $value, string $pattern, int $block_time = 0, ?Request $req = null) : MaybeBlock {
                    Severity: Minor
                    Found in firewall/src/bitfire.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (in_array($bit_lower, ['_COOKIE', '_POST', '_GET'])) {
                                                  continue;
                                              }
                      Severity: Major
                      Found in firewall/src/cms.php - About 45 mins to fix

                        Method file_yield has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function file_yield(string $dirname, string $include_regex_filter = NULL, int $max_files = 20000, int $skip_files = 0, int $stop_time = 0, bool $root = true) : ?\Generator {
                        Severity: Minor
                        Found in firewall/src/util.php - About 45 mins to fix

                          Function g has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          r(/*istanbul ignore end*/s);return{oldFileName:a,newFileName:b,oldHeader:f,newHeader:g,hunks:l}}function f(a,b,c,d,f,g,h){var i=e(a,b,c,d,f,g,h),j=[];a==b&&j.push("Index: "+a),j.push("==================================================================="),j.push("--- "+i.oldFileName+("undefined"==typeof i.oldHeader?"":"\t"+i.oldHeader)),j.push("+++ "+i.newFileName+("undefined"==typeof i.newHeader?"":"\t"+i.newHeader));for(var k=0;k<i.hunks.length;k++){var l=i.hunks[k];j.push("@@ -"+l.oldStart+","+l.oldLines+" +"+l.newStart+","+l.newLines+" @@"),j.push.apply(j,l.lines)}return j.join("\n")+"\n"}function g(a,b,c,d,e,g){return f(a,a,b,c,d,e,g)}b.__esModule=!0,b.structuredPatch=e,/*istanbul ignore start*/
                          Severity: Minor
                          Found in firewall/views/diff.min.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                            (s=/*istanbul ignore end*/o).push.apply(/*istanbul ignore start*/s,/*istanbul ignore start*/d(/*istanbul ignore end*/j(f.slice(0,t))));var u={oldStart:m,oldLines:p-m+t,newStart:n,newLines:q-n+t,lines:o};if(a>=k.length-2&&f.length<=i.context){
                            // EOF is inside this hunk
                            var v=/\n$/.test(c),w=/\n$/.test(e);0!=f.length||v?v&&w||o.push("\\ No newline at end of file"):
                            // special case: old has no eol and no trailing context; no-nl can end up before adds
                            o.splice(u.oldLines,0,"\\ No newline at end of file")}l.push(u),m=0,n=0,o=[]}p+=f.length,q+=f.length}},s=0;s<k.length;s++)/*istanbul ignore start*/
                            Severity: Major
                            Found in firewall/views/diff.min.js - About 45 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                      if (($agent->browser == "chrome" && version_compare($agent->ver, "78.0") < 0)
                                          || ($agent->browser == "edge" && version_compare($agent->ver, "17.0") < 0)
                                          || ($agent->browser == "explorer") || ($agent->browser == "safari")) {
                              
                                          $effect->header("X-XSS-Protection", ": 1; mode=block");
                              Severity: Major
                              Found in firewall/src/headers.php - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                    if (
                                        ($header['hash1'] === $key_hashes[0] && $header['hash2'] === $key_hashes[1]) ||
                                        ($header['expires'] < $ctx['now']) ||
                                        ($priority === CUCKOO_PERM) ||
                                        ($priority > CUCKOO_LOW && !($header['flags'] & CUCKOO_HIGH))
                                Severity: Major
                                Found in firewall/src/cuckoo.php - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if (
                                          ($header['hash1'] === $key_hashes[0] && $header['hash2'] === $key_hashes[1]) ||
                                          ($header['expires'] < $ctx['now']) ||
                                          ($priority === CUCKOO_PERM) ||
                                          ($priority > CUCKOO_LOW && !($header['flags'] & CUCKOO_HIGH))
                                  Severity: Major
                                  Found in firewall/src/cuckoo.php - About 40 mins to fix

                                    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        public function __construct(string $user, string $pass, string $host, string $db_name, string $pre = "") {
                                    Severity: Minor
                                    Found in firewall/src/db.php - About 35 mins to fix

                                      Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          protected function __construct(int $ip_int, int $valid, int $ua_crc, int $exp_time, $answer)
                                      Severity: Minor
                                      Found in firewall/src/botfilter.php - About 35 mins to fix

                                        Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            public function __construct(int $code, string $parameter, string $value, string $pattern, int $block_time = 0) {
                                        Severity: Minor
                                        Found in firewall/src/bitfire.php - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language