Fix Quality Issues using DeepSource (#1183)
Co-authored-by: DeepSource Bot <bot@deepsource.io>
This commit is contained in:
13
.deepsource.toml
Normal file
13
.deepsource.toml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
version = 1
|
||||||
|
|
||||||
|
[[analyzers]]
|
||||||
|
name = "javascript"
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
[analyzers.meta]
|
||||||
|
environment = [
|
||||||
|
"nodejs",
|
||||||
|
"browser"
|
||||||
|
]
|
||||||
|
plugins = ["vue"]
|
||||||
|
module_system="es-modules"
|
||||||
2
build.js
2
build.js
@@ -8,7 +8,7 @@ const PW_BUILD_DATA_DIR = "./.hoppscotch"
|
|||||||
// const IS_DEV_MODE = process.argv.includes("--dev")
|
// const IS_DEV_MODE = process.argv.includes("--dev")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
;(async () => {
|
(async () => {
|
||||||
// Create the build data directory if it does not exist.
|
// Create the build data directory if it does not exist.
|
||||||
if (!fs.existsSync(PW_BUILD_DATA_DIR)) {
|
if (!fs.existsSync(PW_BUILD_DATA_DIR)) {
|
||||||
fs.mkdirSync(PW_BUILD_DATA_DIR)
|
fs.mkdirSync(PW_BUILD_DATA_DIR)
|
||||||
|
|||||||
@@ -320,10 +320,10 @@ export default {
|
|||||||
return items
|
return items
|
||||||
},
|
},
|
||||||
hasFolder(item) {
|
hasFolder(item) {
|
||||||
return item.hasOwnProperty("item")
|
return Object.prototype.hasOwnProperty.call(item, "item")
|
||||||
},
|
},
|
||||||
isSubFolder(item) {
|
isSubFolder(item) {
|
||||||
return item.hasOwnProperty("_postman_isSubFolder") && item._postman_isSubFolder
|
return Object.prototype.hasOwnProperty.call(item, "_postman_isSubFolder") && item._postman_isSubFolder
|
||||||
},
|
},
|
||||||
flattenPostmanItem(subFolder, subFolderGlue = " -- ") {
|
flattenPostmanItem(subFolder, subFolderGlue = " -- ") {
|
||||||
delete subFolder._postman_isSubFolder
|
delete subFolder._postman_isSubFolder
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export default {
|
|||||||
theme: {
|
theme: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
|
default: null
|
||||||
},
|
},
|
||||||
onRunGQLQuery: {
|
onRunGQLQuery: {
|
||||||
type: Function,
|
type: Function,
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
// Initializes the PWA code - checks if the app is installed,
|
// Initializes the PWA code - checks if the app is installed,
|
||||||
// etc.
|
// etc.
|
||||||
;(async () => {
|
(async () => {
|
||||||
this.showInstallPrompt = await intializePwa()
|
this.showInstallPrompt = await intializePwa()
|
||||||
let cookiesAllowed = localStorage.getItem("cookiesAllowed") === "yes"
|
let cookiesAllowed = localStorage.getItem("cookiesAllowed") === "yes"
|
||||||
if (!cookiesAllowed) {
|
if (!cookiesAllowed) {
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ export default {
|
|||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: String,
|
||||||
|
default: ""
|
||||||
},
|
},
|
||||||
active: {
|
active: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export default {
|
|||||||
theme: {
|
theme: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
|
default: null
|
||||||
},
|
},
|
||||||
lang: {
|
lang: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ export default {
|
|||||||
theme: {
|
theme: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
|
default: null,
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|||||||
@@ -7,10 +7,11 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
label: { type: String },
|
label: { type: String, default: "" },
|
||||||
icon: { type: String },
|
icon: { type: String, default: "" },
|
||||||
id: { required: true },
|
id: { required: true },
|
||||||
selected: {
|
selected: {
|
||||||
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
value: { type: String },
|
value: { type: String, default: "" },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class Expectation {
|
|||||||
: this._fail(this._fmtNot(`Expected ${this.expectValue} (not)to be ${value}`))
|
: this._fail(this._fmtNot(`Expected ${this.expectValue} (not)to be ${value}`))
|
||||||
}
|
}
|
||||||
toHaveProperty(value) {
|
toHaveProperty(value) {
|
||||||
return this._satisfies(this.expectValue.hasOwnProperty(value), true)
|
return this._satisfies(Object.prototype.hasOwnProperty.call(this.expectValue, value), true)
|
||||||
? this._pass()
|
? this._pass()
|
||||||
: this._fail(
|
: this._fail(
|
||||||
this._fmtNot(`Expected object ${this.expectValue} to (not)have property ${value}`)
|
this._fmtNot(`Expected object ${this.expectValue} to (not)have property ${value}`)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
export default {
|
export default {
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
// Load theme settings
|
// Load theme settings
|
||||||
;(() => {
|
(() => {
|
||||||
// Apply theme from settings.
|
// Apply theme from settings.
|
||||||
document.documentElement.className = this.$store.state.postwoman.settings.THEME_CLASS || ""
|
document.documentElement.className = this.$store.state.postwoman.settings.THEME_CLASS || ""
|
||||||
// Load theme color data from settings, or use default color.
|
// Load theme color data from settings, or use default color.
|
||||||
|
|||||||
@@ -2604,7 +2604,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async oauthRedirectReq() {
|
async oauthRedirectReq() {
|
||||||
const tokenInfo = await oauthRedirect()
|
const tokenInfo = await oauthRedirect()
|
||||||
if (tokenInfo.hasOwnProperty("access_token")) {
|
if (Object.prototype.hasOwnProperty.call(tokenInfo, "access_token")) {
|
||||||
this.bearerToken = tokenInfo.access_token
|
this.bearerToken = tokenInfo.access_token
|
||||||
this.addOAuthToken({
|
this.addOAuthToken({
|
||||||
name: this.accessTokenName,
|
name: this.accessTokenName,
|
||||||
|
|||||||
@@ -331,9 +331,9 @@ export const mutations = {
|
|||||||
const { request } = payload
|
const { request } = payload
|
||||||
|
|
||||||
// Remove the old request from collection
|
// Remove the old request from collection
|
||||||
if (request.hasOwnProperty("oldCollection") && request.oldCollection > -1) {
|
if (Object.prototype.hasOwnProperty.call(request, "oldCollection") && request.oldCollection > -1) {
|
||||||
const folder =
|
const folder =
|
||||||
request.hasOwnProperty("oldFolder") && request.oldFolder >= -1
|
Object.prototype.hasOwnProperty.call(request, "oldFolder") && request.oldFolder >= -1
|
||||||
? request.oldFolder
|
? request.oldFolder
|
||||||
: request.folder
|
: request.folder
|
||||||
if (folder > -1) {
|
if (folder > -1) {
|
||||||
@@ -341,7 +341,7 @@ export const mutations = {
|
|||||||
} else {
|
} else {
|
||||||
collections[request.oldCollection].requests.splice(request.requestIndex, 1)
|
collections[request.oldCollection].requests.splice(request.requestIndex, 1)
|
||||||
}
|
}
|
||||||
} else if (request.hasOwnProperty("oldFolder") && request.oldFolder !== -1) {
|
} else if (Object.prototype.hasOwnProperty.call(request, "oldFolder") && request.oldFolder !== -1) {
|
||||||
collections[request.collection].folders[folder].requests.splice(request.requestIndex, 1)
|
collections[request.collection].folders[folder].requests.splice(request.requestIndex, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user