Showing 33 of 383 total issues
File DoorlockApiAppResource.java
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package com.wrixton.doorlock.resources;
import com.codahale.metrics.annotation.Timed;
import com.wrixton.doorlock.DAO.BasicDoorlockUser;
import com.wrixton.doorlock.DAO.DoorlockUser;
File userFunctions.php
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
ini_set("session.hash_function", "sha512");
session_name('sid');
session_start();
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
return (
<div className="adminPage">
<table className="userList">
<tr>
File mobile_app.js
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
//TODO add login to app then remove this file
/**
* PiDuinoLock mobile web app
File GetLoggedInUser.js
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
var React = require('react-native');
var {
Function render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
if(!this.state.loaded){
return (<Text>Loading....</Text>);
}
return (
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
return (
<div className="">
<div>
User Info Page
Function renderUserInfo
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderUserInfo: function(){
return (
<View style={styles.container}>
<Text style={styles.pageTitle}>User modification</Text>
<Text>Username:</Text>
Function login
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
login: function() {
console.log("login attempt");
var username = this.refs.username.getDOMNode().value.trim();
var password = this.refs.password.getDOMNode().value.trim();
var token = this.refs.token.getDOMNode().value.trim();
Function registerUser
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
registerUser: function(){
//TODO check username is unique
//email password reset?
//fix 0 to null authyId
//check on frontend
Method equals
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RegisterUserRequest that = (RegisterUserRequest) o;
- 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 render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
var adminNav = '';
var test;
//TODO fix this
var isAdmin = true;
Function getBundleStream
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getBundleStream: function() {
if(!jsBundler) {
JSGulp._createBundler(false);
}
console.log('Bundling JS');
Consider simplifying this complex logical expression. Open
Open
if (isset($_SESSION['username']) && isset($_POST['oldPwd']) && isset($_POST['newPwd']) && isset($_POST['authy']) &&
isset($_POST['card']) && isset($_POST['email']) && isset($_POST['name']) && isset($_POST['confNewPass']) ){
$username = $_SESSION['username'];
$oldPassword = mysql_real_escape_string($_POST['oldPwd']);
$newPassword = mysql_real_escape_string($_POST['newPwd']);
Method equals
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DoorlockUser that = (DoorlockUser) o;
- 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 cookie
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var config = $.cookie = function (key, value, options) {
// Write
if (arguments.length > 1 && !$.isFunction(value)) {
Method run
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void run(DoorlockApiAppConfiguration doorlockApiAppConfiguration, Environment environment) throws Exception {
environment.jersey().register(new ApiListingResource());
final DBIFactory factory = new DBIFactory();
Function update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
connectWith: "ul", items: "li:not(.currentUser)", update: function(event, ui) {
if(ui.sender) {
//TODO make sure username is correct and not tampored with
console.log("selected");
//TODO validate this.... not the best way to do this
Method changeUserInfo
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function changeUserInfo(){
if (isset($_SESSION['username']) && isset($_POST['oldPwd']) && isset($_POST['newPwd']) && isset($_POST['authy']) &&
isset($_POST['card']) && isset($_POST['email']) && isset($_POST['name']) && isset($_POST['confNewPass']) ){
$username = $_SESSION['username'];
$oldPassword = mysql_real_escape_string($_POST['oldPwd']);
Function renderLoginPage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderLoginPage: function() {
if(this.state.loaded && this.state.responseData.success === "1"){
AsyncStorage.setItem(STORAGE_KEY, this.state.sid).done();
return this.userPage();
}