shadowban-eu/TwitterShadowBanV2

View on GitHub

Showing 35 of 35 total issues

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

    document.getElementById("debug_console_minimize_button").addEventListener("click", function(e) {
      ConsoleLogViewer.IS_MINIMIZED = !ConsoleLogViewer.IS_MINIMIZED;
      self.setMinimized(ConsoleLogViewer.IS_MINIMIZED);
      e.preventDefault();
    }, false);
Severity: Major
Found in src/js/console-log-viewer.js and 1 other location - About 1 hr to fix
src/js/console-log-viewer.js on lines 236..240

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

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 show has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

DebugSource.show = function(url,message) {
  var $window = window.open("","_blank");
  var http = new haxe_Http(url.split("#").shift());
  http.onData = function(data) {
    var startLineNumber = Std.parseInt(url.split("#").pop().split("-").shift()) - 1;
Severity: Minor
Found in src/js/console-log-viewer.js - About 1 hr to fix

    Function update has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      update(status, msg) {
        // icon
        const { icon } = this.components;
        switch (status) {
          case 'running':
    Severity: Minor
    Found in src/js/ui/Task.js - About 1 hr to fix

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

        http.onData = function(data) {
          var startLineNumber = Std.parseInt(url.split("#").pop().split("-").shift()) - 1;
          var endLineNumber = Std.parseInt(url.split("#").pop().split("-").pop()) - 1;
          var css = $window.document.createElement("style");
          var stylesheet = "body{font:14px consolas,'courier new',monospaced;background:#FFF;}\npre{max-width:1000px;width:100%;white-space:pre-line;}\n.highlighted-line{background:yellow;display:inline-block;}\n.tab{padding-right:20px;}\n.keyword{color:blue;}\n.operator{color:lightgray;}\n.linenumber{display:inline-block;width:45px;margin-right:5px;background:darkgray;color:white;}\n.debug-error{display:block;background:red;color:white;}";
      Severity: Minor
      Found in src/js/console-log-viewer.js - About 1 hr to fix

        Function onreadystatechange has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var onreadystatechange = function(_) {
              if(r.readyState != 4) return;
              var s;
              try {
                s = r.status;
        Severity: Minor
        Found in src/js/console-log-viewer.js - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                    if(i != 2) str += "," + js_Boot.__string_rec(o[i],s); else str += js_Boot.__string_rec(o[i],s);
          Severity: Major
          Found in src/js/console-log-viewer.js - About 45 mins to fix

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

                var startLineNumber = Std.parseInt(url.split("#").pop().split("-").shift()) - 1;
            Severity: Minor
            Found in src/js/console-log-viewer.js and 1 other location - About 40 mins to fix
            src/js/console-log-viewer.js on lines 320..320

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

            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

                var endLineNumber = Std.parseInt(url.split("#").pop().split("-").pop()) - 1;
            Severity: Minor
            Found in src/js/console-log-viewer.js and 1 other location - About 40 mins to fix
            src/js/console-log-viewer.js on lines 319..319

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

            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

                data = data.split("<").join("&lt;").split(">").join("&gt;").split("\"").join("&quot;");
            Severity: Minor
            Found in src/js/console-log-viewer.js and 1 other location - About 40 mins to fix
            src/js/console-log-viewer.js on lines 84..84

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

            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

                return value.split("<").join("&lt;").split(">").join("&gt;").split("\"").join("&quot;");
            Severity: Minor
            Found in src/js/console-log-viewer.js and 1 other location - About 40 mins to fix
            src/js/console-log-viewer.js on lines 327..327

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

            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 function.
            Open

                  return "???";
            Severity: Major
            Found in src/js/console-log-viewer.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    if(s2 != "[object Object]") return s2;
              Severity: Major
              Found in src/js/console-log-viewer.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return str2;
                Severity: Major
                Found in src/js/console-log-viewer.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return str1;
                  Severity: Major
                  Found in src/js/console-log-viewer.js - About 30 mins to fix

                    Function constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      constructor(test) {
                        // create and add task elements
                        this.tasks = constructTaskData().sort((a, b) => (a.idx - b.idx)).map(task => new Task(task));
                        this.tasksById = this.tasks.reduce(
                          (acc, task) => ({ [task.id]: task, ...acc }),
                    Severity: Minor
                    Found in src/js/ui.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

                    Severity
                    Category
                    Status
                    Source
                    Language