Showing 8 of 19 total issues
Function onmessage
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.onmessage = (message: string) => {
const msg = JSON.parse(message);
switch (msg.action) {
/**
* Initialize the positioning model
Function init
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init() {
ModelBuilder.create()
.addService(new SocketClient())
.withLogger((level: string, log: any) => {
self.postMessage(JSON.stringify({
Function createFrame
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public createFrame(): Promise<void> {
return new Promise<void>((resolve) => {
const dataFrame = new DataFrame();
dataFrame.source = this.source;
Function scan
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
scan() {
this.setState({
...this.state,
scanning: true,
});
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<Container>
<Header title={"Connect"}/>
<Content
Function start
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public start(): Promise<void> {
return new Promise((resolve) => {
this._manager.stopDeviceScan();
this._manager.startDeviceScan(
this.options.uuids,
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<Container>
<MapView
style={{
Method initializeFlipper
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
private static void initializeFlipper(Context context) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
- 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"