Skip to content

Commit 6998d43

Browse files
committed
更新sonar配置
1 parent 75545c6 commit 6998d43

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sonar.projectVersion=9.1.0
66
# Comma-separated paths to directories with sources (required)
77
sonar.sources=src/
88
sonar.inclusions=src/**/*.js
9-
sonar.exclusions=src/**/index.js,src/classic/libs/**/*.js,src/classic/resource/**/*.js,src/classic/theme/**/*.js,src/common/widgets/**/*.js,src/leaflet/widgets/**/*.js
9+
sonar.exclusions=src/**/index.js,src/classic/libs/**/*.js,src/classic/resource/**/*.js,src/classic/theme/**/*.js
1010
# sonar.test.inclusions=test/**/*.js
1111

1212
# Language

test/common/commontypes/UtilSpec.js

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Util', () =>{
1818
"BenoitLink":7,
1919
"Brealey":14763.75,
2020
};
21-
var result = Util.extend(destination, source);
21+
var result = SuperMap.Util.extend(destination, source);
2222
expect(result).toEqual(destination);
2323
});
2424

@@ -31,50 +31,50 @@ describe('Util', () =>{
3131
"fath": 6,
3232
"ind": 9
3333
};
34-
Util.copy(des,soc);
34+
SuperMap.Util.copy(des,soc);
3535
expect(des.fath).toEqual(6);
3636
expect(des.ind).toEqual(9);
3737
});
3838

3939
it('reset', () => {
4040
var obj={"apple":1, "bear":2, banana:{"orange":3},name:['Alice','Jack']};
41-
Util.reset(obj);
41+
SuperMap.Util.reset(obj);
4242
expect(obj.apple).toBe(null);
4343
expect(obj.bear).toBe(null);
4444
expect(obj.banana).toBe(null);
4545
expect(obj.name).toBe(null);
4646
});
4747

4848
it('getElement', () => {
49-
var resulrArr=Util.getElement('string',1,2,3);
49+
var resulrArr=SuperMap.Util.getElement('string',1,2,3);
5050
expect(resulrArr[1]).toEqual(1);
5151
expect(resulrArr[2]).toEqual(2);
5252
});
5353

5454
it('isElement', () => {
5555
var o={a:1,b:2};
56-
var elements=Util.isElement(o);
56+
var elements=SuperMap.Util.isElement(o);
5757
expect(elements).toEqual (false);
5858
});
5959

6060
it('isArray',()=>{
6161
var arr=[1,2];
62-
var obj=Util.isArray(arr);
62+
var obj=SuperMap.Util.isArray(arr);
6363
expect(obj).toEqual(true);
6464
});
6565

6666
it('removeItem', () => {
6767
var arr=[1,2,3,4,5];
6868
var item=5;
69-
var arrResult=Util.removeItem(arr,item);
69+
var arrResult=SuperMap.Util.removeItem(arr,item);
7070
expect(arrResult).toEqual([1,2,3,4]);
7171
});
7272

7373
it('indexOf', () => {
7474
//arr为null的情况
7575
var arr=null;
7676
var obj1={a:"lll"};
77-
var re=Util.indexOf(arr,obj1);
77+
var re=SuperMap.Util.indexOf(arr,obj1);
7878
expect(re).toEqual(-1);
7979
//array不为null的情况
8080
var array=[1,2,3,{ hobby:"dancing"}];
@@ -84,7 +84,7 @@ describe('Util', () =>{
8484
//去掉js语言的数组的indexOf方法
8585
array.indexOf=null;
8686
//测试
87-
var result=Util.indexOf(array,obj);
87+
var result=SuperMap.Util.indexOf(array,obj);
8888
expect(result).toEqual(-1);
8989
//从备份恢复js语言的数组的indexOf方法
9090
//array.indexOf=backUpMethod;
@@ -101,12 +101,12 @@ describe('Util', () =>{
101101
var overflow="hidden";
102102
//opacity<1.0
103103
var opacity = 0.5;
104-
Util.modifyDOMElement(testDom,id,px,sz,position,border,overflow,opacity);
104+
SuperMap.Util.modifyDOMElement(testDom,id,px,sz,position,border,overflow,opacity);
105105
expect(testDom.id).toBe("box");
106106
expect(testDom.style.opacity).toBe('0.5');
107107
//opacity=1.0
108108
var opa = 1.0;
109-
Util.modifyDOMElement(testDom,id,px,sz,position,border,overflow,opa);
109+
SuperMap.Util.modifyDOMElement(testDom,id,px,sz,position,border,overflow,opa);
110110
expect(testDom.style.opa).toBe();
111111
});
112112

@@ -119,7 +119,7 @@ describe('Util', () =>{
119119
toString:"World",
120120
advantage:"difficult"
121121
};
122-
var result=Util.applyDefaults(to,from);
122+
var result=SuperMap.Util.applyDefaults(to,from);
123123
expect(result.advantage).toEqual(from.advantage);
124124
expect(result.toString).toEqual(from.toString);
125125
});
@@ -132,63 +132,63 @@ describe('Util', () =>{
132132
constructor:[1,2,3]
133133
}
134134
};
135-
var paramsArr=Util.getParameterString(params);
135+
var paramsArr=SuperMap.Util.getParameterString(params);
136136
expect(paramsArr).toBe("type=json&coordinates=abc,edf&properties=%5Bobject%20Object%5D");
137137
});
138138

139139
it('urlAppend', () => {
140140
var url="http:/www.baidu.com";
141141
var paramsStr="returnContent=true";
142-
var newUrl=Util.urlAppend(url,paramsStr);
142+
var newUrl=SuperMap.Util.urlAppend(url,paramsStr);
143143
expect(newUrl).toBe("http:/www.baidu.com?returnContent=true");
144144
});
145145

146146
it('toFloat',()=>{
147147
var number="1.234567890345678912345612234555667";
148148
var precision=null;
149-
var newNumber=Util.toFloat(number,precision);
149+
var newNumber=SuperMap.Util.toFloat(number,precision);
150150
expect(newNumber).toEqual(1.2345678903457);
151151
});
152152

153153
it('rad',()=>{
154154
var angle=720;
155-
var result=Util.rad(angle);
155+
var result=SuperMap.Util.rad(angle);
156156
expect(result).toBe(12.566370614359172);
157157
});
158158

159159
it('getParameters',()=>{
160160
var URL=" http://54.223.164.155:8090/iserver/services/addressmatch-Address/restjsr/v1/address?a=1&b=2";
161-
var parameters=Util.getParameters(URL);
161+
var parameters=SuperMap.Util.getParameters(URL);
162162
expect(parameters).toEqual({ a: "1", b: "2" });
163163
});
164164
it('normalizeScale',()=>{
165165
var scale=1/10000000000;
166-
var normScale=Util.normalizeScale(scale);
166+
var normScale=SuperMap.Util.normalizeScale(scale);
167167
expect(normScale).toBe(1e-10);
168168
});
169169

170170
it('getResolutionFromScale',()=>{
171171
var scale=1/1250000000;
172172
var units=null;
173-
var resolution=Util.getResolutionFromScale(scale,units);
173+
var resolution=SuperMap.Util.getResolutionFromScale(scale,units);
174174
expect(resolution).toEqual(2.97635783253946);
175175
});
176176

177177
it('getScaleFromResolution',()=>{
178178
var getScaleFromResolution=2.97635783253946;
179179
var units=null;
180-
var scale=Util.getScaleFromResolution(getScaleFromResolution,units);
180+
var scale=SuperMap.Util.getScaleFromResolution(getScaleFromResolution,units);
181181
expect(scale).toEqual(1250000000);
182182
});
183183

184184

185185
it('isInTheSameDomain',()=>{
186186
var Url="http://iclient.supermap.io/examples/leaflet/editor.html#addressMatchService";
187-
var correct=Util.isInTheSameDomain(Url);
187+
var correct=SuperMap.Util.isInTheSameDomain(Url);
188188
expect(correct).toBeFalsy(false);
189189

190190
var errorUrl="httttttp:wwwwwww.bbbb";
191-
var error=Util.isInTheSameDomain(errorUrl);
191+
var error=SuperMap.Util.isInTheSameDomain(errorUrl);
192192
expect(error).toBeTruthy(true);
193193
});
194194

@@ -198,14 +198,14 @@ describe('Util', () =>{
198198
var scale=4.629244301712164E-9;
199199
var coordUnit="DEGREE";
200200
var datumAxis=6378137;
201-
var dpi=Util.calculateDpi(viewBounds,viewer,scale,coordUnit,datumAxis);
201+
var dpi=SuperMap.Util.calculateDpi(viewBounds,viewer,scale,coordUnit,datumAxis);
202202
expect(dpi).toEqual(95.99999999999964);
203203
});
204204

205205
it('toJSON',()=>{
206206
//1、obj为null
207207
var nullObj=null;
208-
var result=Util.toJSON(nullObj);
208+
var result=SuperMap.Util.toJSON(nullObj);
209209
expect(result).toBe(null);
210210
//2、obj不为null
211211
//var date = new Date();
@@ -218,7 +218,7 @@ describe('Util', () =>{
218218
true:true,
219219
time:"Wed Sep 19 2018 15:33:53 GMT+0800 (中国标准时间)"
220220
};
221-
var jsonObj=Util.toJSON(obj);
221+
var jsonObj=SuperMap.Util.toJSON(obj);
222222
expect(jsonObj).toEqual(`{'1':1,'resourceConfigID':"maps",'resourceType':"CatalogList",'array':[1,2,3,4,5,6],'true':true,'time':"Wed Sep 19 2018 15:33:53 GMT+0800 (中国标准时间)"}`);
223223

224224
//obj[ "toJSON"]为function
@@ -227,7 +227,7 @@ describe('Util', () =>{
227227
return "aaa";
228228
}
229229
};
230-
var funResults=Util.toJSON(funObj);
230+
var funResults=SuperMap.Util.toJSON(funObj);
231231
expect(funResults).toEqual("aaa");
232232
});
233233

@@ -236,7 +236,7 @@ describe('Util', () =>{
236236
var dpi=95.99999999999964;
237237
var coordUnit="DEGREE";
238238
var datumAxis=6378137;
239-
var result=Util.getResolutionFromScaleDpi(scale,dpi,coordUnit,datumAxis);
239+
var result=SuperMap.Util.getResolutionFromScaleDpi(scale,dpi,coordUnit,datumAxis);
240240
expect(result).toEqual(0.513429918072625);
241241

242242
});
@@ -246,7 +246,7 @@ describe('Util', () =>{
246246
var dpi=95.99999999999964;
247247
var coordUnit="DEGREE";
248248
var datumAxis=6378137;
249-
var result=Util.getScaleFromResolutionDpi(resolution,dpi,coordUnit,datumAxis);
249+
var result=SuperMap.Util.getScaleFromResolutionDpi(resolution,dpi,coordUnit,datumAxis);
250250
expect(result).toEqual(4.629244301712165e-9);
251251
});
252252

@@ -255,7 +255,7 @@ describe('Util', () =>{
255255
true:true,
256256
respose:"helloWorld"
257257
};
258-
Util.transformResult(result);
258+
SuperMap.Util.transformResult(result);
259259
expect(result).toEqual({"true":true,"respose":"helloWorld"})
260260

261261
});
@@ -267,7 +267,7 @@ describe('Util', () =>{
267267
birthday:"八月十九",
268268
};
269269
var des={};
270-
Util.copyAttributes(des,soc);
270+
SuperMap.Util.copyAttributes(des,soc);
271271
expect(des).toEqual(soc);
272272
});
273273

@@ -291,7 +291,7 @@ describe('Util', () =>{
291291
var clip=[
292292
"say","CLASS_NAME"
293293
];
294-
Util.copyAttributesWithClip(source,destination,clip);
294+
SuperMap.Util.copyAttributesWithClip(source,destination,clip);
295295
expect(destination.name).toEqual(source.name);
296296
expect(destination.hobby).toEqual(source.hobby);
297297
expect(destination.age).toEqual(source.age);
@@ -304,7 +304,7 @@ describe('Util', () =>{
304304
age:18,
305305
height:160
306306
};
307-
var copy=Util.cloneObject(needCloneObj);
307+
var copy=SuperMap.Util.cloneObject(needCloneObj);
308308
expect(copy).toEqual(needCloneObj);
309309
});
310310

@@ -314,14 +314,14 @@ describe('Util', () =>{
314314
var a2 = new SuperMap.Geometry.Point(-152, 89);
315315
var a3 = new SuperMap.Geometry.Point(-111.04, 45.68);
316316
var a4 = new SuperMap.Geometry.Point(-152, 89);
317-
var intersectValue=Util.lineIntersection(a1,a2,a3,a4);
317+
var intersectValue=SuperMap.Util.lineIntersection(a1,a2,a3,a4);
318318
expect(intersectValue).toEqual("Coincident");
319319
//平行
320320
var a5 = new SuperMap.Geometry.Point(20, 80);
321321
var a6 = new SuperMap.Geometry.Point(140, 160);
322322
var a7 = new SuperMap.Geometry.Point(20, 20);
323323
var a8 = new SuperMap.Geometry.Point(140, 100);
324-
var intersectValue1 =Util.lineIntersection(a5,a6,a7,a8);
324+
var intersectValue1 =SuperMap.Util.lineIntersection(a5,a6,a7,a8);
325325
expect(intersectValue1).toEqual("Parallel");
326326
});
327327

@@ -338,7 +338,7 @@ describe('Util', () =>{
338338
});
339339
var text = "北京超图";
340340
var dom = document.createElement('div');
341-
var result=Util.getTextBounds(style,text,dom);
341+
var result=SuperMap.Util.getTextBounds(style,text,dom);
342342
expect(result.textWidth).toBeGreaterThan(60);
343343
expect(result.textWidth).toBeLessThan(70);
344344
expect(result.textHeight).toEqual(18);

0 commit comments

Comments
 (0)