Passed
Push — master ( 2ac20a...d01831 )
by Javier
03:34 queued 01:31
created

app.js ➔ newEventPoll   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A app.js ➔ ... ➔ ??? 0 3 1
1
import EventPoll from '../event_poll'
2
import { ulid } from 'ulid'
3
4
class App {
5
  constructor (baseUrl, eventPollRepository) {
6
    this.baseUrl = baseUrl
7
    this.eventPollRepository = eventPollRepository
8
  }
9
10
  newEventPoll (aTitle, posibleDates) {
11
    const aEventPoll = new EventPoll(ulid(), this.baseUrl, aTitle, posibleDates)
12
    this.eventPollRepository.save(aEventPoll)
13
    return new Promise((resolve) => {
14
      resolve(aEventPoll.id)
15
    })
16
  }
17
}
18
19
export default App
20