1.0.10 • Published 3 years ago

@kebs/project-metrics v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Project Metrics: Node.js Client

Nodejs library for calculating the metrics for Project Governance

@kebs/project-metrics allows you to calculate the following metrics:

Installing the library

$ npm install @kebs/project-metrics

Calculate the project progress

// Imports the library
const projectmetric = require("@kebs/project-metrics");

/**
 * --------------------------- SAMPLE INPUT ---------------------------- 
    const "plan": [
        {
            "id": "1",
            "wbs": "1",
            "title": "Prepare",
            "plannedduration": "",
            "plannedweightage": 30,
            "actualweightage": "",
            "plannedfrom": "",
            "plannedto": "",
            "status": "",
            "assignedto": ""
        },
        {
            "id": "2",
            "wbs": "1.1",
            "title": "System Preparation",
            "plannedduration": "40",
            "plannedweightage": 10,
            "actualweightage": "",
            "plannedfrom": "2021-09-27",
            "plannedto": "2021-10-01",
            "status": "Completed",
            "assignedto": "101"
        },
        {
            "id": "3",
            "wbs": "1.1.1",
            "title": "System Creation",
            "plannedduration": "24",
            "plannedweightage": 10,
            "actualweightage": 10,
            "plannedfrom": "2021-09-23",
            "plannedto": "2021-09-25",
            "status": "Completed",
            "assignedto": "101"
        },
        {
            "id": "4",
            "wbs": "1.2",
            "title": "Stakeholder Onboarding",
            "plannedduration": "40",
            "plannedweightage": 20,
            "actualweightage": "",
            "plannedfrom": "2021-09-27",
            "plannedto": "2021-10-01",
            "status": "New",
            "assignedto": "103"
        },
        {
            "id": "5",
            "wbs": "2",
            "title": "Explore",
            "plannedduration": "",
            "plannedweightage": 70,
            "actualweightage": "",
            "plannedfrom": "",
            "plannedto": "",
            "status": "",
            "assignedto": ""
        },
        {
            "id": "6",
            "wbs": "2.1",
            "title": "Unit Testing",
            "plannedduration": "80",  
            "plannedweightage": 70,
            "actualweightage": "",
            "plannedfrom": "2021-09-19",
            "plannedto": "2021-09-28",
            "status": "Active",
            "assignedto": "102"
        }
    ];

    var configurations = {
      completedstatus: "",              
      activestatus: "Active",           // Status value which indicates that the item is currently in progress
      durationunit: "",                 
      activepercentagecompletion: 20,   // Percentage of completion to be considered for "Active" items
      progresstype: ""                  // Specify which attribute to consider for calculating the overall project progress
    };
*/

// To calculate the planned value
const projectprogress = projectmetric.calculateProjectProgress(plan, configurations);

'progresstype' can be either one of the following:

  • weightage (default)
  • duration
  • storypoint
  • cost

Also note that, planned and actual fields for the specified progress metric must be available in the 'plan' data. For example, if the progresstype is 'weightage', then 'plan' data must contain 'plannedweightage' and 'actualweightage' fields

Calculate the project metrics

// Imports the library
const projectmetric = require("@kebs/project-metrics");

/**
 * --------------------------- SAMPLE INPUT ---------------------------- 
    const users = [
        {
            "id": "101",
            "fullname": "Andrew Strauss",
            "salary": "100"
        },
        {
            "id": "102",
            "fullname": "Peter Roddick",
            "salary": "150"
        },
        {
            "id": "103",
            "fullname": "Mark Forest",
            "salary": "175"
        }
    ];
    const plan = [
        {
            "id": "1",
            "wbs": "1",
            "title": "Prepare",
            "plannedduration": "",
            "plannedfrom": "",
            "plannedto": "",
            "status": "",
            "assignedto": ""
        },
        {
            "id": "2",
            "wbs": "1.1",
            "title": "System Preparation",
            "plannedduration": "40",
            "plannedfrom": "2021-09-27",
            "plannedto": "2021-10-01",
            "status": "Completed",
            "assignedto": "101"
        },
        {
            "id": "3",
            "wbs": "1.1.1",
            "title": "System Creation",
            "plannedduration": "24",
            "plannedfrom": "2021-09-23",
            "plannedto": "2021-09-25",
            "status": "Completed",
            "assignedto": "101"
        },
        {
            "id": "4",
            "wbs": "1.2",
            "title": "Stakeholder Onboarding",
            "plannedduration": "40",
            "plannedfrom": "2021-09-27",
            "plannedto": "2021-10-01",
            "status": "New",
            "assignedto": "103"
        },
        {
            "id": "5",
            "wbs": "2",
            "title": "Explore",
            "plannedduration": "",
            "plannedfrom": "",
            "plannedto": "",
            "status": "",
            "assignedto": ""
        },
        {
            "id": "6",
            "wbs": "2.1",
            "title": "Unit Testing",
            "plannedduration": "80",  
            "plannedfrom": "2021-09-19",
            "plannedto": "2021-09-28",
            "status": "Active",
            "assignedto": "102"
        }
    ];
    var configurations = {
      completedstatus: "Completed",     // Status value which indicates the completion of an item
      activestatus: "Active",           // Status value which indicates that the item is currently in progress
      durationunit: "hours",            // Unit of the plannedduration field ("hours" or "days")
      activepercentagecompletion: 20,   // Percentage of completion to be considered for "Active" items
      progresstype: ""
    };
*/

// To calculate the planned value
const plannedvalue = projectmetric.calculatePV(plan, users, configurations);

// To calculate the earned value
const earnedvalue = projectmetric.calculateEV(plan, users, configurations);

// To calculate the cost performance index
const costperformanceindex = projectmetric.calculateCPI(earnedvalue, actualcost);

// To calculate the cost variance
const costvariance = projectmetric.calculateCV(earnedvalue, actualcost);

// To calculate the schedule performance index
const scheduleperformanceindex = projectmetric.calculateSPI(earnedvalue, plannedvalue);

// To calculate the schedule variance
const schedulevariance = projectmetric.calculateSV(earnedvalue, plannedvalue);

Key points to be noted

  • Status values present in the "configurations" key must be present in the "status" key of the "plan" data
  • Actual cost must be of number type

License

Apache Version 2.0

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago