OpenGems/redis_web_manager

View on GitHub
app/assets/javascripts/redis_web_manager/dashboard.js

Summary

Maintainability
C
7 hrs
Test Coverage

Function renderMemory has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function renderMemory(node, data) {
        const labels = data.map(d => humanizeDate(d['date']));
        const memories = data.map(d => d['memory']);
        const used_memory = memories.map(x => parseInt(x['used_memory'], 10));
        const used_memory_rss = memories.map(x => parseInt(x['used_memory_rss'], 10));
Severity: Major
Found in app/assets/javascripts/redis_web_manager/dashboard.js - About 3 hrs to fix

    Function renderCpu has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function renderCpu(node, data) {
            const labels = data.map(d => humanizeDate(d['date']));
            const cpus = data.map(d => d['cpu']);
            const used_cpu_sys = cpus.map(x => parseInt(x['used_cpu_sys'], 10));
            const used_cpu_user = cpus.map(x => parseInt(x['used_cpu_user']));
    Severity: Major
    Found in app/assets/javascripts/redis_web_manager/dashboard.js - About 2 hrs to fix

      Function renderClient has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function renderClient(node, data) {
              const labels = data.map(d => humanizeDate(d['date']));
              const clients = data.map(d => d['client']);
              const connected_clients = clients.map(x => parseInt(x['connected_clients'], 10));
              const blocked_clients = clients.map(x => parseInt(x['blocked_clients'], 10));
      Severity: Minor
      Found in app/assets/javascripts/redis_web_manager/dashboard.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status