juanmard/icestudio

View on GitHub
plugins/icerok/js/iceRok.js

Summary

Maintainability
C
1 day
Test Coverage

Function iceRok has 128 lines of code (exceeds 25 allowed). Consider refactoring.
Open

let iceRok = function (port) {
  this.tcps = {
    port: 9999,
    connected: false,
    server: false,
Severity: Major
Found in plugins/icerok/js/iceRok.js - About 5 hrs to fix

    Function iceRok has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    let iceRok = function (port) {
      this.tcps = {
        port: 9999,
        connected: false,
        server: false,
    Severity: Minor
    Found in plugins/icerok/js/iceRok.js - About 4 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

    Function startTCPS has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      this.startTCPS = function (port, _onStart) {
        console.log('startTCPS');
        if (this.tcps.connected === true) return false;
        console.log('Open Server at port ' + port);
        this.tcps.port = parseInt(port);
    Severity: Minor
    Found in plugins/icerok/js/iceRok.js - About 1 hr to fix

      Function getNetworkInterfaces has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        this.getNetworkInterfaces = function (callback) {
          let ips = [];
          let RTCPeerConnection =
            window.RTCPeerConnection ||
            window.webkitRTCPeerConnection ||
      Severity: Minor
      Found in plugins/icerok/js/iceRok.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status