Showing 80 of 224 total issues
Method Auther.GetGitHubOAuthInfo
has 6 return statements (exceeds 4 allowed). Open
func (a *Auther) GetGitHubOAuthInfo(resState string, code string) (*OAuthInfo, error) {
if resState != a.state {
return nil, fmt.Errorf("invalid state")
}
ctx := context.Background()
Function ConnectRailNode
has 6 return statements (exceeds 4 allowed). Open
func ConnectRailNode(o *entities.Player, from *entities.RailNode, to *entities.RailNode, scale int) (*entities.DelegateRailEdge, error) {
if err := CheckAuth(o, from); err != nil {
return nil, err
}
if err := CheckAuth(o, to); err != nil {
Method Chunk.Has
has 6 return statements (exceeds 4 allowed). Open
func (ch *Chunk) Has(raw Entity) bool {
id := reflect.ValueOf(raw.B().ID)
switch obj := raw.(type) {
case Localable:
fieldName := obj.B().T.String()
Function CreatePlayer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func CreatePlayer(loginid string, displayname string, password string, hue int, lv entities.PlayerType) (*entities.Player, error) {
Function ExtendRailNode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func ExtendRailNode(o *entities.Player, from *entities.RailNode,
x float64, y float64, scale int) (*entities.DelegateRailNode, *entities.DelegateRailEdge, error) {
Function PasswordSignUp
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func PasswordSignUp(loginid string, name string, password string, hue int, lv entities.PlayerType) (*entities.Player, error) {
Function WarnLongExec
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func WarnLongExec(start time.Time, lock time.Time, max time.Duration, title string, verbose ...bool) {
Method Auther.GetTwitterOAuthInfo
has 5 return statements (exceeds 4 allowed). Open
func (a *Auther) GetTwitterOAuthInfo(tmpCred *oauth.Credentials, tmpSecret string) (*OAuthInfo, error) {
cred, values, err := twitterClient.RequestToken(&http.Client{}, tmpCred, tmpSecret)
if err != nil {
return nil, err
}
Avoid too many return
statements within this function. Open
return Object.assign({}, state, inOperation);
Avoid too many return
statements within this function. Open
return Object.assign({}, state, { inOperation });
Avoid too many return
statements within this function. Open
return Object.assign({}, state, { inPurge });
Avoid too many return
statements within this function. Open
return Object.assign({}, state, { players });
Avoid too many return
statements within this function. Open
return Object.assign({}, state, { inOperation });
Avoid too many return
statements within this function. Open
return Object.assign({}, state, { inPurge });
Avoid too many return
statements within this function. Open
return Object.assign({}, state, { players });
Function default
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function() {
const theme = useTheme();
const classes = useStyles(theme);
const isTiny = useMediaQuery(theme.breakpoints.down("xs"));
const [, update] = useContext(LoadingContext);
- 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 makeCube
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const makeCube = (dlg: number, length: number) => {
const buffer: Chunk[] = [];
for (let i = 0; i <= length; i++) {
for (let j = 0; j <= length; j++) {
for (let k = 0; k <= length; k++) {
- 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 useMultiTask
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const useMultiTask = <I, O>(
task: Task<I, O>,
handlers?: MultiTaskHandler<I, O>
): Handlers<I> => {
const [, maintain] = useContext(OperationContext);
- 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 merge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
merge(key: string, value: any) {
if (!this.equals(key, value)) {
if (!(value instanceof Object)) {
this.props[key] = value;
} else {
- 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 http
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function http(
url: string,
method: Method = Method.GET,
params: { [index: string]: any } = {}
) {
- 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"