Raoul1996/vue-vote

View on GitHub

Showing 5 of 5 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

async loginAction ({commit, state}, data) {
const res = await userLogin(data)
if (res && res.token) {
window.localStorage.setItem('token', res.token)
commit(USER_TOKEN, res.token)
Severity: Major
Found in src/store/actions.js and 1 other location - About 3 hrs to fix
src/store/actions.js on lines 46..54

Similar blocks of code found in 2 locations. Consider refactoring.
Open

async registerAction ({commit, state}, data) {
const res = await userRegister(data)
if (res && res.token) {
window.localStorage.setItem('token', res.token)
commit(USER_TOKEN, res.token)
Severity: Major
Found in src/store/actions.js and 1 other location - About 3 hrs to fix
src/store/actions.js on lines 37..45

Function cssLoaders has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.cssLoaders = function (options) {
options = options || {}
 
const cssLoader = {
loader: 'css-loader',
Severity: Minor
Found in build/utils.js - About 1 hr to fix

    Function cssLoaders has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    exports.cssLoaders = function (options) {
    options = options || {}
     
    const cssLoader = {
    loader: 'css-loader',
    Severity: Minor
    Found in build/utils.js - About 45 mins to fix

    Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function () {
    const warnings = []
    for (let i = 0; i < versionRequirements.length; i++) {
    const mod = versionRequirements[i]
    if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
    Severity: Minor
    Found in build/check-versions.js - About 25 mins to fix
    Severity
    Category
    Status
    Source
    Language