rodrigogs/github-metrics

View on GitHub

Showing 98 of 98 total issues

Function Dashboard has 406 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Dashboard = ((window, document, $, Promise, toastr, dragula, Chart, randomColor, Color, moment, _, App, ProjectService, ColumnService, ReportService, LabelService) => {
/* Charts */
let cfdChart;
let wipChart;
let leadTimeChart;
Severity: Major
Found in src/public/javascript/dashboard.js - About 2 days to fix

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

    const _summarizeCardEvents = async (processedDeliveries) => {
    const cardEvents = await CardEvent
    .find({ delivery: { $not: { $in: processedDeliveries } } }).exec();
     
    let cardsTodo = cardEvents.length;
    Severity: Major
    Found in src/services/v1/summary.v1.service.js and 1 other location - About 5 hrs to fix
    src/services/v1/summary.v1.service.js on lines 298..313

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

    const _summarizeIssueEvents = async (processedDeliveries) => {
    const issueEvents = await IssueEvent
    .find({ delivery: { $not: { $in: processedDeliveries } } }).exec();
     
    let issuesTodo = issueEvents.length;
    Severity: Major
    Found in src/services/v1/summary.v1.service.js and 1 other location - About 5 hrs to fix
    src/services/v1/summary.v1.service.js on lines 276..291

    File dashboard.js has 409 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const Dashboard = ((window, document, $, Promise, toastr, dragula, Chart, randomColor, Color, moment, _, App, ProjectService, ColumnService, ReportService, LabelService) => {
    /* Charts */
    let cfdChart;
    let wipChart;
    let leadTimeChart;
    Severity: Minor
    Found in src/public/javascript/dashboard.js - About 5 hrs to fix

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

      static async saveFromUrl(url) {
      if (!url) throw new Error('Trying to resolve a reference without url');
       
      debug('saving from url', url);
       
       
      Severity: Major
      Found in src/services/v1/column.v1.service.js and 4 other locations - About 5 hrs to fix
      src/services/v1/card.v1.service.js on lines 87..102
      src/services/v1/issue.v1.service.js on lines 80..95
      src/services/v1/label.v1.service.js on lines 35..50
      src/services/v1/project.v1.service.js on lines 75..90

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

      static async saveFromUrl(url) {
      if (!url) throw new Error('Trying to resolve a reference without url');
       
      debug('saving from url', url);
       
       
      Severity: Major
      Found in src/services/v1/project.v1.service.js and 4 other locations - About 5 hrs to fix
      src/services/v1/card.v1.service.js on lines 87..102
      src/services/v1/column.v1.service.js on lines 78..93
      src/services/v1/issue.v1.service.js on lines 80..95
      src/services/v1/label.v1.service.js on lines 35..50

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

      static async saveFromUrl(url) {
      if (!url) throw new Error('Trying to resolve a reference without url');
       
      debug('saving from url', url);
       
       
      Severity: Major
      Found in src/services/v1/label.v1.service.js and 4 other locations - About 5 hrs to fix
      src/services/v1/card.v1.service.js on lines 87..102
      src/services/v1/column.v1.service.js on lines 78..93
      src/services/v1/issue.v1.service.js on lines 80..95
      src/services/v1/project.v1.service.js on lines 75..90

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

      static async saveFromUrl(url) {
      if (!url) throw new Error('Trying to resolve a reference without url');
       
      debug('saving from url', url);
       
       
      Severity: Major
      Found in src/services/v1/issue.v1.service.js and 4 other locations - About 5 hrs to fix
      src/services/v1/card.v1.service.js on lines 87..102
      src/services/v1/column.v1.service.js on lines 78..93
      src/services/v1/label.v1.service.js on lines 35..50
      src/services/v1/project.v1.service.js on lines 75..90

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

      static async saveFromUrl(url) {
      if (!url) throw new Error('Trying to resolve a reference without url');
       
      debug('saving from url', url);
       
       
      Severity: Major
      Found in src/services/v1/card.v1.service.js and 4 other locations - About 5 hrs to fix
      src/services/v1/column.v1.service.js on lines 78..93
      src/services/v1/issue.v1.service.js on lines 80..95
      src/services/v1/label.v1.service.js on lines 35..50
      src/services/v1/project.v1.service.js on lines 75..90

      Function Dashboard has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

      const Dashboard = ((window, document, $, Promise, toastr, dragula, Chart, randomColor, Color, moment, _, App, ProjectService, ColumnService, ReportService, LabelService) => {
      /* Charts */
      let cfdChart;
      let wipChart;
      let leadTimeChart;
      Severity: Minor
      Found in src/public/javascript/dashboard.js - About 4 hrs to fix

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

      static async saveEvent(event) {
      if (!event) throw new Error('Trying to save an empty entity');
       
      debug('saving event', JSON.stringify(event));
       
       
      Severity: Major
      Found in src/services/v1/issue.v1.service.js and 1 other location - About 4 hrs to fix
      src/services/v1/card.v1.service.js on lines 56..67

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

      static async saveEvent(event) {
      if (!event) throw new Error('Trying to save an empty entity');
       
      debug('saving event', JSON.stringify(event));
       
       
      Severity: Major
      Found in src/services/v1/project.v1.service.js and 1 other location - About 4 hrs to fix
      src/services/v1/column.v1.service.js on lines 47..58

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

      static async saveEvent(event) {
      if (!event) throw new Error('Trying to save an empty entity');
       
      debug('saving event', JSON.stringify(event));
       
       
      Severity: Major
      Found in src/services/v1/card.v1.service.js and 1 other location - About 4 hrs to fix
      src/services/v1/issue.v1.service.js on lines 49..60

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

      static async saveEvent(event) {
      if (!event) throw new Error('Trying to save an empty entity');
       
      debug('saving event', JSON.stringify(event));
       
       
      Severity: Major
      Found in src/services/v1/column.v1.service.js and 1 other location - About 4 hrs to fix
      src/services/v1/project.v1.service.js on lines 44..55

      Function initCharts has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const initCharts = () => {
      cfdChart = new Chart(cfdCanvas[0], {
      type: 'line',
      options: {
      responsive: true,
      Severity: Major
      Found in src/public/javascript/dashboard.js - About 3 hrs to fix

        File report.v1.service.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* eslint-disable no-multi-assign */
        const debug = require('debug')('github-metrics:services:v1:report');
        const moment = require('moment');
        const _ = require('lodash');
        const Color = require('color');
        Severity: Minor
        Found in src/services/v1/report.v1.service.js - About 3 hrs to fix

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

          wip: async (req, res, next) => {
          debug('executing wip action');
           
          const { project_id: projectId, from_date: from, to_date: to } = req.query;
           
           
          Severity: Major
          Found in src/controllers/v1/report.v1.controller.js and 3 other locations - About 3 hrs to fix
          src/controllers/v1/report.v1.controller.js on lines 31..42
          src/controllers/v1/report.v1.controller.js on lines 69..80
          src/controllers/v1/report.v1.controller.js on lines 88..99

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

          cfd: async (req, res, next) => {
          debug('executing cfd action');
           
          const { project_id: projectId, from_date: from, to_date: to } = req.query;
           
           
          Severity: Major
          Found in src/controllers/v1/report.v1.controller.js and 3 other locations - About 3 hrs to fix
          src/controllers/v1/report.v1.controller.js on lines 50..61
          src/controllers/v1/report.v1.controller.js on lines 69..80
          src/controllers/v1/report.v1.controller.js on lines 88..99

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

          leadtime: async (req, res, next) => {
          debug('executing leadtime action');
           
          const { project_id: projectId, from_date: from, to_date: to } = req.query;
           
           
          Severity: Major
          Found in src/controllers/v1/report.v1.controller.js and 3 other locations - About 3 hrs to fix
          src/controllers/v1/report.v1.controller.js on lines 31..42
          src/controllers/v1/report.v1.controller.js on lines 50..61
          src/controllers/v1/report.v1.controller.js on lines 88..99

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

          throughput: async (req, res, next) => {
          debug('executing throughput action');
           
          const { project_id: projectId, from_date: from, to_date: to } = req.query;
           
           
          Severity: Major
          Found in src/controllers/v1/report.v1.controller.js and 3 other locations - About 3 hrs to fix
          src/controllers/v1/report.v1.controller.js on lines 31..42
          src/controllers/v1/report.v1.controller.js on lines 50..61
          src/controllers/v1/report.v1.controller.js on lines 69..80
          Severity
          Category
          Status
          Source
          Language