Passed
Pull Request — master (#25)
by Hamed
01:17
created

raw_code/vite/5.0.10/Panel/src/stores/counter.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 12
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 8
mnd 0
bc 0
fnc 3
dl 0
loc 12
rs 10
bpm 0
cpm 1
noi 1
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A counter.js ➔ increment 0 3 3
1
import { ref, computed } from 'vue'
2
import { defineStore } from 'pinia'
3
4
export const useCounterStore = defineStore('counter', () => {
5
  const count = ref(0)
6
  const doubleCount = computed(() => count.value * 2)
7
  function increment() {
0 ignored issues
show
Bug introduced by
The function increment is declared conditionally. This is not supported by all runtimes. Consider moving it to root scope or using var increment = function() { /* ... */ }; instead.
Loading history...
8
    count.value++
9
  }
10
11
  return { count, doubleCount, increment }
12
})
13