bitslip6/bitfire

View on GitHub

Showing 749 of 749 total issues

Similar blocks of code found in 2 locations. 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 and 1 other location - About 30 mins to fix
firewall/views/diff.min.js on lines 402..402

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

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

Avoid too many return statements within this method.
Open

    return doc_root();
Severity: Major
Found in wordpress-plugin/bitfire-plugin.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return $block;
    Severity: Major
    Found in firewall/src/botfilter.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return $result;
      Severity: Major
      Found in firewall/src/util.php - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                if (byteLength !== getByteLength(b)) return false;
        Severity: Major
        Found in public/underscore.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return deepEq(a, b, aStack, bStack);
          Severity: Major
          Found in public/underscore.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  if (typeof a != 'object' || typeof b != 'object') return false;
            Severity: Major
            Found in public/underscore.js - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                  return $result;
              Severity: Major
              Found in wordpress-plugin/bitfire-admin.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return $eqfn($block_class, $block_code);
                Severity: Major
                Found in firewall/src/dashboard.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return "wp_core";
                  Severity: Major
                  Found in wordpress-plugin/includes.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return $b->last_time - $a->last_time;
                    Severity: Major
                    Found in firewall/src/dashboard.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return $eqfn($x["block"]["code"], $block_code);
                      Severity: Major
                      Found in firewall/src/dashboard.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                            return $response;
                        Severity: Major
                        Found in firewall/src/http.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return BitFire::get_instance()->new_block(FAIL_SQL_ORDER, $name, $matches[0], ERR_SQL_INJECT, BLOCK_NONE);
                          Severity: Major
                          Found in firewall/src/webfilter.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                return $effect;
                            Severity: Major
                            Found in firewall/src/bitfire.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                  return $parsed_agent;
                              Severity: Major
                              Found in firewall/src/botfilter.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                    return false;
                                Severity: Major
                                Found in firewall/src/botfilter.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                      return $list;
                                  Severity: Major
                                  Found in firewall/src/cms.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    if (strpos($key_name, "metric") !== false) { return false; }
                                    Severity: Major
                                    Found in firewall/src/storage.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                  return true;
                                      Severity: Major
                                      Found in firewall/src/cuckoo.php - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language