infusion-code/angular-maps

View on GitHub

Showing 344 of 396 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

private ManageTooltip(): void {
if (this._showTooltip && this._title != null && this._title !== '') {
const o: { [key: string]: any } = {
text: this._title,
align: 'left',
Severity: Major
Found in src/models/google/google-polyline.ts and 1 other location - About 3 days to fix
src/models/google/google-polygon.ts on lines 399..451

Similar blocks of code found in 2 locations. Consider refactoring.
Open

private ManageTooltip(): void {
if (this._showTooltip && this._title != null && this._title !== '') {
const o: { [key: string]: any } = {
text: this._title,
align: 'left',
Severity: Major
Found in src/models/google/google-polygon.ts and 1 other location - About 3 days to fix
src/models/google/google-polyline.ts on lines 242..294

Similar blocks of code found in 2 locations. Consider refactoring.
Open

private ManageTooltip(show: boolean): void {
if (show && this._canvas) {
// add tooltip subscriptions
this._tooltip.Set('hidden', true);
this._tooltipVisible = false;
Severity: Major
Found in src/components/map-polyline-layer.ts and 1 other location - About 2 days to fix
src/components/map-polygon-layer.ts on lines 401..437

Similar blocks of code found in 2 locations. Consider refactoring.
Open

private ManageTooltip(show: boolean): void {
if (show && this._canvas) {
// add tooltip subscriptions
this._tooltip.Set('hidden', true);
this._tooltipVisible = false;
Severity: Major
Found in src/components/map-polygon-layer.ts and 1 other location - About 2 days to fix
src/components/map-polyline-layer.ts on lines 401..437

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public UpdatePolyline(polyline: MapPolylineDirective): Promise<void> {
const m = this._polylines.get(polyline);
if (m == null) {
return Promise.resolve();
}
Severity: Major
Found in src/services/bing/bing-polyline.service.ts and 1 other location - About 2 days to fix
src/services/google/google-polyline.service.ts on lines 175..192

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public UpdatePolyline(polyline: MapPolylineDirective): Promise<void> {
const m = this._polylines.get(polyline);
if (m == null) {
return Promise.resolve();
}
Severity: Major
Found in src/services/google/google-polyline.service.ts and 1 other location - About 2 days to fix
src/services/bing/bing-polyline.service.ts on lines 184..201

Similar blocks of code found in 2 locations. Consider refactoring.
Open

private DrawLabels(el: HTMLCanvasElement): void {
if (this.ShowLabels) {
this._mapService.GetZoom().then(z => {
if (this.LabelMinZoom <= z && this.LabelMaxZoom >= z) {
const ctx: CanvasRenderingContext2D = el.getContext('2d');
Severity: Major
Found in src/components/map-polygon-layer.ts and 1 other location - About 1 day to fix
src/components/map-polyline-layer.ts on lines 352..370

Similar blocks of code found in 2 locations. Consider refactoring.
Open

private DrawLabels(el: HTMLCanvasElement): void {
if (this.ShowLabels) {
this._mapService.GetZoom().then(z => {
if (this.LabelMinZoom <= z && this.LabelMaxZoom >= z) {
const ctx: CanvasRenderingContext2D = el.getContext('2d');
Severity: Major
Found in src/components/map-polyline-layer.ts and 1 other location - About 1 day to fix
src/components/map-polygon-layer.ts on lines 352..370

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public ngOnChanges(changes: { [key: string]: SimpleChange }) {
if (changes['PolygonOptions']) {
this._zone.runOutsideAngular(() => {
this.UpdatePolygons();
});
Severity: Major
Found in src/components/map-polygon-layer.ts and 1 other location - About 1 day to fix
src/components/map-polyline-layer.ts on lines 290..315

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public ngOnChanges(changes: { [key: string]: SimpleChange }) {
if (changes['PolylineOptions']) {
this._zone.runOutsideAngular(() => {
this.UpdatePolylines();
});
Severity: Major
Found in src/components/map-polyline-layer.ts and 1 other location - About 1 day to fix
src/components/map-polygon-layer.ts on lines 290..315

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const f: (s: string, a: number) => string = (s, a) => {
const m = /rgba?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*\d+[\.\d+]*)*\)/g.exec(s);
if (m && m.length > 3) {
a = a > 1 ? (a / 100) : a;
return 'rgba(' + [m[1], m[2], m[3], a].join(',') + ')';
Severity: Major
Found in src/services/bing/bing-conversions.ts and 1 other location - About 1 day to fix
src/services/bing/bing-conversions.ts on lines 444..461

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const f: (s: string, a: number) => string = (s, a) => {
const m = /rgba?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*\d+[\.\d+]*)*\)/g.exec(s);
if (m && m.length > 3) {
a = a > 1 ? (a / 100) : a;
return 'rgba(' + [m[1], m[2], m[3], a].join(',') + ')';
Severity: Major
Found in src/services/bing/bing-conversions.ts and 1 other location - About 1 day to fix
src/services/bing/bing-conversions.ts on lines 504..521

Similar blocks of code found in 2 locations. Consider refactoring.
Open

private AddEventListeners(p: Polyline): void {
const handlers = [
{ name: 'click', handler: (ev: MouseEvent) => this.PolylineClick.emit({Polyline: p, Click: ev}) },
{ name: 'dblclick', handler: (ev: MouseEvent) => this.PolylineDblClick.emit({Polyline: p, Click: ev}) },
{ name: 'mousemove', handler: (ev: MouseEvent) => this.PolylineMouseMove.emit({Polyline: p, Click: ev}) },
Severity: Major
Found in src/components/map-polyline-layer.ts and 1 other location - About 1 day to fix
src/components/map-polygon-layer.ts on lines 335..344

Similar blocks of code found in 2 locations. Consider refactoring.
Open

private AddEventListeners(p: Polygon): void {
const handlers = [
{ name: 'click', handler: (ev: MouseEvent) => this.PolygonClick.emit({Polygon: p, Click: ev}) },
{ name: 'dblclick', handler: (ev: MouseEvent) => this.PolygonDblClick.emit({Polygon: p, Click: ev}) },
{ name: 'mousemove', handler: (ev: MouseEvent) => this.PolygonMouseMove.emit({Polygon: p, Click: ev}) },
Severity: Major
Found in src/components/map-polygon-layer.ts and 1 other location - About 1 day to fix
src/components/map-polyline-layer.ts on lines 335..344

Identical blocks of code found in 2 locations. Consider refactoring.
Open

private DrawText(ctx: CanvasRenderingContext2D, loc: IPoint, text: string) {
let lo: ILabelOptions = this.LabelOptions;
if (lo == null && this._tooltip) { lo = this._tooltip.DefaultLabelStyle; }
if (lo == null) { lo = this._defaultOptions; }
 
 
Severity: Major
Found in src/components/map-polygon-layer.ts and 1 other location - About 1 day to fix
src/components/map-polyline-layer.ts on lines 378..393

Identical blocks of code found in 2 locations. Consider refactoring.
Open

private DrawText(ctx: CanvasRenderingContext2D, loc: IPoint, text: string) {
let lo: ILabelOptions = this.LabelOptions;
if (lo == null && this._tooltip) { lo = this._tooltip.DefaultLabelStyle; }
if (lo == null) { lo = this._defaultOptions; }
 
 
Severity: Major
Found in src/components/map-polyline-layer.ts and 1 other location - About 1 day to fix
src/components/map-polygon-layer.ts on lines 378..393

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public CreateEventObservable<T>(eventName: string, marker: MapMarkerDirective): Observable<T> {
const b: Subject<T> = new Subject<T>();
if (eventName === 'mousemove') {
return b.asObservable();
}
Severity: Major
Found in src/services/bing/bing-marker.service.ts and 1 other location - About 1 day to fix
src/services/bing/bing-polygon.service.ts on lines 90..107

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public CreateEventObservable<T>(eventName: string, polygon: MapPolygonDirective): Observable<T> {
const b: Subject<T> = new Subject<T>();
if (eventName === 'mousemove') {
return b.asObservable();
}
Severity: Major
Found in src/services/bing/bing-polygon.service.ts and 1 other location - About 1 day to fix
src/services/bing/bing-marker.service.ts on lines 113..132

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public UpdatePolygon(polygon: MapPolygonDirective): Promise<void> {
const m = this._polygons.get(polygon);
if (m == null || polygon.Paths == null || !Array.isArray(polygon.Paths) || polygon.Paths.length === 0) {
return Promise.resolve();
}
Severity: Major
Found in src/services/bing/bing-polygon.service.ts and 1 other location - About 1 day to fix
src/services/google/google-polygon.service.ts on lines 164..177

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public UpdatePolygon(polygon: MapPolygonDirective): Promise<void> {
const m = this._polygons.get(polygon);
if (m == null || polygon.Paths == null || !Array.isArray(polygon.Paths) || polygon.Paths.length === 0) {
return Promise.resolve();
}
Severity: Major
Found in src/services/google/google-polygon.service.ts and 1 other location - About 1 day to fix
src/services/bing/bing-polygon.service.ts on lines 179..192
Severity
Category
Status
Source
Language