jaxon-examples/public/js/lang/jaxon.tr.js   A
last analyzed

Complexity

Total Complexity 7
Complexity/F 1.4

Size

Lines of Code 76
Function Count 5

Duplication

Duplicated Lines 21
Ratio 27.63 %

Importance

Changes 0
Metric Value
eloc 51
dl 21
loc 76
rs 10
c 0
b 0
f 0
wmc 7
mnd 2
bc 2
fnc 5
bpm 0.4
cpm 1.4
noi 2

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
/**
2
 * translation for: jaxon v.x.x
3
 * @version: 1.0.0
4
 * @author: mic <[email protected]>
5
 * @copyright jaxon project
6
 * @license GNU/GPL
7
 * @package jaxon x.x.x
8
 * @since v.x.x.x
9
 * save as UTF-8
10
 */
11
12
if ('undefined' != typeof jaxon.debug) {
0 ignored issues
show
Bug introduced by
The variable jaxon seems to be never declared. If this is a global, consider adding a /** global: jaxon */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
13
    /*
14
        Array: text
15
    */
16
    jaxon.debug.messages = {
17
        warning: 'IKAZ: ',
18
        error: 'HATA: ',
19
        heading: 'JAXON DEBUG (HATA AYIKLAMASI) MESAJI:\n',
20
        request: {
21
            uri: 'URI: ',
22
            init: 'ISTEK BASLATILIYOR',
23
            creating: 'ISTEK NESNESI BASLATILIYOR',
24
            starting: 'JAXON ISTEGI BASLATILIYOR',
25
            preparing: 'ISTEK HAZIRLANIYOR',
26
            calling: 'ÇAGIRILIYOR: ',
27
            sending: 'ISTEK GÖNDERILIYOR',
28
            sent: 'GÖNDERILDI [{length} byte]'
29
        },
30
        response: {
31
            long: '...\n[UZUN YANIT]\n...',
32
            success: 'ALINDI [durum: {status}, boyut: {length} byte, süre: {duration}ms]:\n',
33
            content: 'Sunucu asagidaki HTTP durumunu gönderdi: {status}\nALINDI:\n{text}',
34
            redirect: 'Sunucu su adrese yönlendirme istegi gönderdi :<br />{location}',
35
            no_processor: 'Sunucudan gelen cevabi isleyecek cevap islemcisi yok.\n',
36
            check_errors: '.\nSunucudan gelen hata mesajlarini kontrol edin.'
37
        },
38
        processing: {
39
            parameters: 'PARAMETRELER ISLENIYOR [{count}]',
40
            no_parameters: 'ISLENECEK PARAMETRE YOK',
41
            calling: 'JAXON ÇAGRISI BASLATILIYOR (kullanimi tavsiye edilmiyor: yerine jaxon.request kullanin)',
0 ignored issues
show
Unused Code Bug introduced by
The key calling is used more than once in this object expression.
Loading history...
42
            calling: 'JAXON BASLATILIYOR ({cmd}, {options})',
43
            done: 'TAMAMLANDI [{duration}ms]'
44
        }
45
    };
46
    
47
    /*
48
        Array: exceptions
49
    */
50
    jaxon.debug.exceptions = [];
51
    jaxon.debug.exceptions[10001] = 'Geçersiz XML cevabi: Cevap bilinmeyen bir etiket tasiyor: {data}.';
52
    jaxon.debug.exceptions[10002] = 'GetRequestObject: XMLHttpRequest hazir degil, jaxon nesnesi etkisizlestirildi.';
53
    jaxon.debug.exceptions[10003] = 'Islem kuyrugu fazla yüklendi: Kuyruk dolu oldugu için nesne kuyruga eklenemiyor.';
54
    jaxon.debug.exceptions[10004] = 'Geçersiz XML cevabi: Cevap bilinmeyen bir etiket veya metin tasiyor: {data}.';
55
    jaxon.debug.exceptions[10005] = 'Geçersiz istek URI: Geçersiz veya kayip URI; otomatik tespit yapilamadi; lütfen açikça bir tane belirleyiniz.';
56
    jaxon.debug.exceptions[10006] = 'Geçersiz cevap komutu: Bozulmus cevap komutu alindi.';
57
    jaxon.debug.exceptions[10007] = 'Geçersiz cevap komutu: [{data}] komutu bilinmiyor.';
58
    jaxon.debug.exceptions[10008] = '[{data}] ID li element dosya içinde bulunamadi.';
59
    jaxon.debug.exceptions[10009] = 'Geçersiz istek: Fonksiyon isim parametresi eksik.';
60
    jaxon.debug.exceptions[10010] = 'Geçersiz istek: Fonksiyon nesne parametresi eksik.';
61
62
    jaxon.debug.lang = {
63
        isLoaded: true
64
    };
65
}
66
67 View Code Duplication
if (typeof jaxon.config != 'undefined' && typeof jaxon.config.status != 'undefined') {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
68
    /*
69
        Object: update
70
    */
71
    jaxon.config.status.update = function() {
72
        return {
73
            onRequest: function() {
74
                window.status = 'İstek Gönderiliyor...';
75
            },
76
            onWaiting: function() {
77
                window.status = 'Cevap Bekleniyor...';
78
            },
79
            onProcessing: function() {
80
                window.status = 'İşlem Devam Ediyor...';
81
            },
82
            onComplete: function() {
83
                window.status = 'Tamamlandı.';
84
            }
85
        }
86
    }
87
}
88