Showing 344 of 396 total issues
Function GetVisible
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected GetVisible() {
const minZoom: number = this.Get('minZoom');
const maxZoom: number = this.Get('maxZoom');
const hidden: boolean = this.Get('hidden');
- 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 GetPixelsFromClick
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public GetPixelsFromClick(e: MouseEvent | any): IPoint {
if (!e || !e.latLng || !e.latLng.lat || !e.latLng.lng) {
return null;
}
if (this._mapService.MapInstance == 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"
Further reading
Function TranslatePaths
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static TranslatePaths(paths: Array<ILatLong> | Array<Array<ILatLong>>): Array<Array<GoogleMapTypes.LatLng>> {
const p: Array<Array<GoogleMapTypes.LatLng>> = new Array<Array<GoogleMapTypes.LatLng>>();
if (paths == null || !Array.isArray(paths) || paths.length === 0) {
p.push(new Array<GoogleMapTypes.LatLng>());
}
- 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 CreateMarker
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public CreateMarker(layer: number, options: IMarkerOptions): Promise<Marker> {
const payload = (icon: string, l: Layer): BingMarker => {
const loc: Microsoft.Maps.Location = BingConversions.TranslateLocation(options.position);
const o: Microsoft.Maps.IPushpinOptions = BingConversions.TranslateMarkerOptions(options);
if (icon && icon !== '') { o.icon = icon; }
- 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"