Function parseDeviceList
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
async parseDeviceList( pDeviceListStr){
let dev = [], ret=null,re=null, data=null, id=null, device=null, token=null;
let bridge = null;
Logger.debug(pDeviceListStr);
- 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
File AdbWrapper.js
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
const Process = require("child_process");
const _path_ = require('path');
const UT = require("./Utils.js");
const Device = require("./Device.js");
Function parseDeviceList
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
async parseDeviceList( pDeviceListStr){
let dev = [], ret=null,re=null, data=null, id=null, device=null, token=null;
let bridge = null;
Logger.debug(pDeviceListStr);
AdbWrapper
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class AdbWrapper
{
static USB_TRANSPORT = 'U';
static TCP_TRANSPORT = 'T';
Function setup
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
setup(pDeviceID = null, pReturnString = true){
let cmd=null;
if(pReturnString)
cmd = this.path;
- 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 parsePackageList
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
parsePackageList( pPackageListStr, pOptions=''){
var reg = new RegExp("^package:(?<apk_name>.*)");
var packages = [];
if(pPackageListStr.indexOf("error:")==0){
Function setup
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup(pDeviceID = null, pReturnString = true){
let cmd=null;
if(pReturnString)
cmd = this.path;
Function toJsonObject
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
toJsonObject( pExcludeList={}){
let o = new Object();
for(let i in this){
if(pExcludeList[i] === false) 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"