Skip to content

Latest commit

 

History

History
341 lines (209 loc) · 7.89 KB

docs.md

File metadata and controls

341 lines (209 loc) · 7.89 KB

Table of Contents

calculateMetric

Calculates the issue response time metric by using a GraphQL call to get issues with comments at the same time instead of 2 separate calls with REST. Consider only issues whose first comment author != author of issue

Parameters

  • owner
  • libName
  • req Object Express request object

Returns Array 3 items, number of all issues, number of issues that have valid comments, and calculated metric

issueresponsetime

GET endpoint to get average number of days for first issue comment that is authored by someone not the issue creator

Parameters

  • req Object Express request object

Examples

localhost:3000/issueresponse?owner=axios&libname=axios

Returns number average number of days for issue response time

lastdiscussedbadge

Finds the last date discussed on Stack Overflow by selecting tag asssociated with library with largest number of questions then grab the most recent question containing the tag of the library and extract date

Parameters

  • req object Express middleware request object

Examples

localhost:3000/lastdiscussed?libname=axios

Returns string latestdate of the last discussed on Stack Overflow

grabDates

Grab the dates from every response objects for when a release is made

Parameters

  • response Array list of response API objects of releases

Returns Array list of date strings of every commit associated with a release

calculateAverage

Calculates the average number of days between releases by getting the difference between each date string

Parameters

  • dates Array list of date strings

Returns number average number days between releases

insertEntry

Inserts into the database the library name, number of releases, average days, and status

Parameters

  • data Array list containing the library name, number of releases, average days, and status

Returns null

updateEntry

Updates the number of releases, average days, and status of the query in the database

Parameters

  • data Array list containing number of releases, average days, and status of query

Returns null

getReleases

Gets the commit tags associated with releases and gets the detailed commit URL for each tag

Parameters

  • owner string owner name of the library
  • libName string library name
  • numberofreleases numberofreleases total number of releases

Examples

localhost:3000/releasefreq?owner=axios&libname=axios

Returns number average number days between releases

releasebadge

Gets the average number of days between releases and updates/inserts corresponding info in database

Parameters

  • req object Express request object

Returns Array contains calculated average number and the status of the query whether if the average stayed neutral, increased, or decreased

classifyUserType

Classify contributor user type by checking if total number commits user made is less than 10% of all commits

Parameters

  • owner string representing the owner of the repository
  • libName string representing the name of the repository/library

Examples

owner=google libName=gson

Returns object contributors -> key:users, value:number of commits made

classifyusers

GET request endpoint that creates a JSON object that contains users that are classified as contributors for the pull requests endpoint

Parameters

  • req object contains the request user made

Examples

localhost:3000/classifyusers?owner=axios&libname=axios

Returns object Github contributors of a repo

getAllPRs

Grabs all PRs in repository and filters them based on those associated with a contributor user status and grabs various PR metrics for later calculation

Parameters

  • owner string representing the owner of the repository
  • libName string representing the name of the repository/library
  • contributors object with keys as contributor login names, and values as number of commits associated with user
  • lastDate
  • date string is undefined for contains the last cached date

Examples

owner=google libName=gson contributors={user1:12,user2:3} lastDate="1970-01-01T00:00:00Z"

Returns Array number of merged PRs, number of contributor PRs, and total number of all PRs, and the most recent date of last PR

pullrequests

GET request endpoint that calculates metric of contributor's merged PRs and stores it into database given a library and owner name

Parameters

  • req object contains the request user made

Examples

localhost:3000/pullrequests?owner=axios&libname=axios

Returns number percentage containing number of outside contributor's work that is merged into repo

window

!

Copyright 2013 LinkedIn Corp. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

securitybadge

GET request to grab the number of bugs detected by Spotbugs with FindSecBugs plugin from database

Parameters

  • req object Express middleware request object

Returns object contains the number of bugs found from Spotbugs and the status of the query