MichalKononenko/OmicronClient

View on GitHub

Showing 5 of 128 total issues

File test_login.js has 279 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Created by Michal on 2016-02-22.
 * Contains unit tests for the authenticator
 */
import expect from 'expect';
Severity: Minor
Found in src/auth/__tests__/test_login.js - About 2 hrs to fix

    Function render has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        render(){
            return(
                <div id="developer_resources_links">
                    <button className="btn btn-default" onClick={
                        () => {this.setState({open: !this.state.open})}
    Severity: Minor
    Found in src/containers/footer.js - About 1 hr to fix

      Function exports has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function(config) {
          config.set({
      
              browsers: [ 'PhantomJS' ],
      
      
      Severity: Minor
      Found in karma.conf.js - About 1 hr to fix

        Function logout_user has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function logout_user(){
            return function(dispatch){
                let state;
        
                dispatch(logout_started());
        Severity: Minor
        Found in src/auth/logout.js - About 1 hr to fix

          Function login_button_clicked has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          export const login_button_clicked = (state=store.getState()) => (dispatch) => {
          
              let is_authenticating = state.auth.front_end.is_authenticating;
              let is_logging_out = state.auth.front_end.is_logging_out;
          
          
          Severity: Minor
          Found in src/components/user_control_button.js - About 1 hr to fix

          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

          Severity
          Category
          Status
          Source
          Language