pumpkin-zbh / amqp_comm_example

Use const declarations for variables that are never reassigned JS-0242
Anti-pattern
Minor
a year ago2 years old
'client' is never reassigned. Use 'const' instead
117        let rawdata = fs.readFileSync(jsonFile);
118        let person = JSON.parse(rawdata);
119        console.log(person.START_JUMP)
120        let client = Client.createClient(ALIYUN.ACCESS_KEY, ALIYUN.ACCESS_KEY_SECRET);121        await Client.BatchPubSample(client, ALIYUN.PRODUCT_KEY, ALIYUN.IOT_INSTANCE_ID, base64encode(JSON.stringify(person.START_JUMP)), topic, sn);
122    }
123}
'person' is never reassigned. Use 'const' instead
115        const topic = "get";
116        const sn = ALIYUN.DEVICE_NAME;
117        let rawdata = fs.readFileSync(jsonFile);
118        let person = JSON.parse(rawdata);119        console.log(person.START_JUMP)
120        let client = Client.createClient(ALIYUN.ACCESS_KEY, ALIYUN.ACCESS_KEY_SECRET);
121        await Client.BatchPubSample(client, ALIYUN.PRODUCT_KEY, ALIYUN.IOT_INSTANCE_ID, base64encode(JSON.stringify(person.START_JUMP)), topic, sn);
'rawdata' is never reassigned. Use 'const' instead
114    static async publishJumpingOrder() {
115        const topic = "get";
116        const sn = ALIYUN.DEVICE_NAME;
117        let rawdata = fs.readFileSync(jsonFile);118        let person = JSON.parse(rawdata);
119        console.log(person.START_JUMP)
120        let client = Client.createClient(ALIYUN.ACCESS_KEY, ALIYUN.ACCESS_KEY_SECRET);
'client' is never reassigned. Use 'const' instead
106        let rawdata = fs.readFileSync(jsonFile);
107        let person = JSON.parse(rawdata);
108        console.log(person.GROUPING)
109        let client = Client.createClient(ALIYUN.ACCESS_KEY, ALIYUN.ACCESS_KEY_SECRET);110        await Client.BatchPubSample(client, ALIYUN.PRODUCT_KEY, ALIYUN.IOT_INSTANCE_ID, base64encode(JSON.stringify(person.GROUPING)), topic, sn);
111    }
112
'person' is never reassigned. Use 'const' instead
104        const topic = "get";
105        const sn = ALIYUN.DEVICE_NAME;
106        let rawdata = fs.readFileSync(jsonFile);
107        let person = JSON.parse(rawdata);108        console.log(person.GROUPING)
109        let client = Client.createClient(ALIYUN.ACCESS_KEY, ALIYUN.ACCESS_KEY_SECRET);
110        await Client.BatchPubSample(client, ALIYUN.PRODUCT_KEY, ALIYUN.IOT_INSTANCE_ID, base64encode(JSON.stringify(person.GROUPING)), topic, sn);