Completed
Pull Request — master (#8)
by Javier
02:32
created

src/application/app.js   A

Complexity

Total Complexity 4
Complexity/F 1.33

Size

Lines of Code 19
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 0
eloc 12
nc 1
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 4
mnd 0
bc 3
fnc 3
bpm 1
cpm 1.3333
noi 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A app.js ➔ constructor 0 4 1
A app.js ➔ newEventPoll 0 7 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