Showing 15 of 43 total issues
File bluetooth.ts
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
import {Injectable, Inject} from '@angular/core';
import { UartService } from '../service';
import { UserData } from '../../../providers/user-data';
Function gpsToggle
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
gpsToggle(value) {
if (this.userData.plate == null) {
this.userData.showToast('Vehicle should be selected!', 'Error!', this.alertCtrl);
} else {
if (value) {
Function setPostData
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
setPostData(data, storage, urlApi) {
var arrayData = [];
if(data == null) {
Function bledeviceChanged
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
bledeviceChanged(value, positions, ask) {
if (this.bledevice == value && ask) {
if (confirm("Deseja sair?")) {
this.clearDevice();
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', 'angular-cli'],
plugins: [
Function processTireData
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
processTireData(buffer: ArrayBuffer):any {
var dataView = new DataView(buffer);
if (dataView.getUint8(0) != 0xAA
Function _printDataView
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_printDataView(dataView: DataView) {
//alert("tire data: " + this.uart._buffer2String(dataView.buffer));
if (dataView.byteLength > 4 && dataView.getUint8(3) == dataView.byteLength) {
var tire = this.uart.processTireData(dataView.buffer);
Function subscribeRepeater
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
subscribeRepeater() {
var thing = this;
BluetoothSerial.isConnected().then(
(result) => {
this.watcher = BluetoothSerial.subscribeRawData().subscribe(
Function onSubmit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
onSubmit(value: any): void {
if(this.fuelForm.valid || value.valid) {
console.log('Submitted value: ', value);
let params: any = {};
Function _resetIfHasStart
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_resetIfHasStart(cbPrint: (dataView: DataView) => void) {
var dataView = new DataView(this.buffer);
for (let i = 1; i < dataView.byteLength; i++) {
if (dataView.getUint8(i) == 0xAA && dataView.byteLength > (i + 2)) {
- 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 processTireData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
processTireData(buffer: ArrayBuffer):any {
var dataView = new DataView(buffer);
if (dataView.getUint8(0) != 0xAA
- 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 gpsToggle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
gpsToggle(value) {
if (this.userData.plate == null) {
this.userData.showToast('Vehicle should be selected!', 'Error!', this.alertCtrl);
} else {
if (value) {
- 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 bledeviceChanged
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
bledeviceChanged(value, positions, ask) {
if (this.bledevice == value && ask) {
if (confirm("Deseja sair?")) {
this.clearDevice();
- 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 onSubmit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
onSubmit(value: any): void {
if(this.fuelForm.valid || value.valid) {
console.log('Submitted value: ', value);
let params: any = {};
- 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 setPostData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
setPostData(data, storage, urlApi) {
var arrayData = [];
if(data == null) {
- 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"