Showing 39 of 62 total issues
Function __generator
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __generator
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __generator
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __generator
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function ValidatorPlugin
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
var ValidatorPlugin = /** @class */ (function () {
function ValidatorPlugin() {
this.defaultType = {
phone: /^1[34578]\d{9}$/,
email: /^[a-z0-9]+([._\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function validator
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
private validator(data: any, validator: Validator, request: tenp.Request, response: tenp.Response): boolean {
const done = validator.done ? validator.done : this.globalDone ? this.globalDone : this.defaultDone;
let result: boolean = false;
for(let name in validator){
if(name == 'done') continue;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function ValidatorPlugin
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ValidatorPlugin = /** @class */ (function () {
function ValidatorPlugin() {
this.defaultType = {
phone: /^1[34578]\d{9}$/,
email: /^[a-z0-9]+([._\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
Function InterceptorPlugin
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
var InterceptorPlugin = /** @class */ (function () {
function InterceptorPlugin() {
this.globalInterceptor = [];
this.routerInterceptor = [];
}
Function ReceivePlugin
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ReceivePlugin = /** @class */ (function () {
function ReceivePlugin(argument) {
// code...
}
//Default receiving rule
Function exports
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(argv){
const isNo = argv.indexOf('--no') == -1 ? false : true;
argv = argv.filter(v => v != '--no');
const name = argv[0];
Function start
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports.start = function(argv){
if(!tsconfig.compilerOptions) return con.error('\r\n $ 未发现tsconfig配置文件');
const outDir = path.join(cwd, tsconfig.compilerOptions.outDir);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function tsWatch
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tsWatch(process_server, error){
let CompileError = false;
var configPath = ts.findConfigFile(
Function start
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.start = function(argv){
if(!tsconfig.compilerOptions) return con.error('\r\n $ 未发现tsconfig配置文件');
const outDir = path.join(cwd, tsconfig.compilerOptions.outDir);
Function validator
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
ValidatorPlugin.prototype.validator = function (data, validator, request, response) {
var done = validator.done ? validator.done : this.globalDone ? this.globalDone : this.defaultDone;
var result = false;
for (var name_1 in validator) {
if (name_1 == 'done')
Function createPackage
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function createPackage(name){
console.log('create init')
let pacakge = {};
pacakge.name = await readlinePromise(` package name: (${name})`) || name;
const validateresult = validate(pacakge.name);
Function InterceptorPlugin
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
var InterceptorPlugin = /** @class */ (function () {
function InterceptorPlugin() {
this.globalInterceptor = [];
this.routerInterceptor = [];
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function InjectorPlugin
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var InjectorPlugin = /** @class */ (function () {
function InjectorPlugin() {
this.globalProvide = {};
}
InjectorPlugin.prototype.onTenp = function (config) {
Function defaultReceive
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
ReceivePlugin.prototype.defaultReceive = function (request) {
var contentType = request.headers['content-type'];
if (contentType.indexOf('multipart/form-data;') != -1) {
return new Promise(function (resolve, reject) {
var form = new formidable.IncomingForm();
Function tsWatch
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function tsWatch(process_server, error){
let CompileError = false;
var configPath = ts.findConfigFile(
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function writeFile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
ts.sys.writeFile = function(fileName, data, writeByteOrderMark) {
// If a BOM is required, emit one
if (writeByteOrderMark) {
data = byteOrderMarkIndicator + data;
}